package com.ruoyi.im;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.im.comm.Result;
|
import com.ruoyi.im.service.ImApiServcie;
|
import com.ruoyi.im.dto.RegisterDto;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@RestController
|
@RequestMapping("/im/api")
|
@Slf4j
|
public class ImApiController {
|
|
@Autowired
|
private ImApiServcie imApiServcie;
|
|
/**
|
* 获取参数配置列表
|
*/
|
@PostMapping("/register")
|
public Result register(@Validated RegisterDto dto){
|
try {
|
return imApiServcie.register(dto);
|
}catch (Exception e){
|
log.error("注册报错:",e);
|
return Result.error("注册失败,请稍后再试!");
|
}
|
}
|
}
|