puzhibing
2022-09-29 e28d33c09405e246a2d75fcb1f69a9e8e9d911b8
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
@@ -7,6 +7,7 @@
import com.stylefeng.guns.core.support.HttpKit;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.service.IReportLossService;
import com.stylefeng.guns.modular.system.service.ISmsrecordService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.service.IVerifiedService;
@@ -46,6 +47,9 @@
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private IReportLossService reportLossService;
@@ -780,4 +784,48 @@
        }
    }
    @ResponseBody
    @PostMapping("/api/user/editLanguage")
    @ApiOperation(value = "修改多语言配置", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "1=中文,2=英文,3=法语", name = "language", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil editLanguage(Integer language, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            UserInfo userInfo = userInfoService.selectById(uid);
            userInfo.setLanguage(language);
            userInfoService.updateById(userInfo);
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/base/user/addReportLoss")
    @ApiOperation(value = "提交报失", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城出行,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "提交内容", name = "remark", required = true, dataType = "int"),
            @ApiImplicitParam(value = "提交图片", name = "image", required = true, dataType = "int"),
    })
    public ResultUtil addReportLoss(Integer orderType, Integer orderId, String remark, String image){
        try {
            reportLossService.addReportLoss(orderType, orderId, remark, image);
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}