package com.ym.mec.teacher.controller;


import com.ym.mec.auth.api.client.SysUserFeignService;
import com.ym.mec.auth.api.entity.SysUser;
import com.ym.mec.biz.dal.entity.SysImComplaint;
import com.ym.mec.biz.service.SysImComplaintService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("sysImComplaint")
@Api(tags = "im投诉服务")
@RestController
public class SysImComplaintController extends BaseController {

    @Autowired
    private SysImComplaintService sysImComplaintService;
    @Autowired
    private SysUserFeignService sysUserFeignService;

    @ApiOperation(value = "新增")
    @PostMapping("/add")
    public Object getOrgans(SysImComplaint sysImComplaint) {
        SysUser sysUser = sysUserFeignService.queryUserInfo();
        sysImComplaint.setUserId(sysUser.getId());
        return succeed(sysImComplaintService.insert(sysImComplaint));
    }
}
