package com.chushang.system.remote;

import com.chushang.common.core.web.AjaxResult;
import com.chushang.common.core.web.Result;
import com.chushang.security.entity.vo.LoginUser;
import com.chushang.system.entity.dto.UserQcCodeDTO;
import com.chushang.system.entity.po.SysUserQcCode;
import com.chushang.system.feign.RemoteUserQcCodeService;
import com.chushang.system.service.ISysUserQcCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Objects;

/**
 * @author by zhaowenyuan create 2022/8/22 16:43
 * 部门相关
 */
@RestController
@RequestMapping("/qc")
public class SysUserQcCodeController implements RemoteUserQcCodeService {

    @Autowired
    private ISysUserQcCodeService service;


    @Override
    @PostMapping(value = "/qccode/query")
    public Result<SysUserQcCode> getUserInfo(@RequestBody UserQcCodeDTO userQcCodeDTO) {
        return Result.ok(service.getInfo(userQcCodeDTO.getUserId()));
    }

    @Override
    @PostMapping(value = "/save/qccode")
    public Result<Integer> save(@RequestBody UserQcCodeDTO userQcCodeDTO) {
        return Result.ok(service.save(userQcCodeDTO));
    }
}
