环信接口
This commit is contained in:
parent
b41f845689
commit
265b64e9eb
|
|
@ -1,14 +1,20 @@
|
||||||
package com.ruoyi.web.controller.app;
|
package com.ruoyi.web.controller.app;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.common.core.domain.Result;
|
import com.ruoyi.common.core.domain.Result;
|
||||||
import com.ruoyi.system.domain.TbUserMatchGroup;
|
import com.ruoyi.system.domain.TbUserMatchGroup;
|
||||||
import com.ruoyi.system.service.ITbUserMatchGroupService;
|
import com.ruoyi.system.service.ITbUserMatchGroupService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>合伙人创建活动团</p>
|
* <p>合伙人创建活动团</p>
|
||||||
* @author clunt
|
* @author clunt
|
||||||
|
|
@ -22,6 +28,33 @@ public class TbUserMatchGroupAppController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ITbUserMatchGroupService tbUserMatchGroupService;
|
private ITbUserMatchGroupService tbUserMatchGroupService;
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/getByMatchId")
|
||||||
|
@ApiOperation(value = "获取我的活动团", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, dataType = "int"),
|
||||||
|
@ApiImplicitParam(name = "pageSize", value = "每页显示的条数", required = true, dataType = "int") })
|
||||||
|
public Result<PageInfo<TbUserMatchGroup>> getByMatchId(@RequestBody TbUserMatchGroup tbUserMatchGroup,
|
||||||
|
@RequestParam("pageNum") int pageNum,
|
||||||
|
@RequestParam("pageSize") int pageSize)
|
||||||
|
{
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
List<TbUserMatchGroup> list = tbUserMatchGroupService.selectTbUserMatchGroupList(tbUserMatchGroup);
|
||||||
|
return Result.success(PageInfo.of(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ApiOperation(value = "更新活动团", httpMethod = "POST")
|
||||||
|
public Result<String> edit(@RequestBody TbUserMatchGroup tbUserMatchGroup)
|
||||||
|
{
|
||||||
|
int effectiveRows = tbUserMatchGroupService.updateTbUserMatchGroup(tbUserMatchGroup);
|
||||||
|
if(effectiveRows > 0){
|
||||||
|
return Result.success("更新活动团成功!");
|
||||||
|
}else {
|
||||||
|
return Result.error("更新活动团成功失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation(value = "创建活动团", httpMethod = "POST")
|
@ApiOperation(value = "创建活动团", httpMethod = "POST")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.Result;
|
||||||
|
import com.ruoyi.system.domain.TbUser;
|
||||||
|
import com.ruoyi.system.service.ITbUserService;
|
||||||
|
import com.ruoyi.web.request.CommonReq;
|
||||||
|
import com.ruoyi.web.response.HxResp;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>环信接口</p>
|
||||||
|
* @author clunt
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "App*环信接口")
|
||||||
|
@RequestMapping(value = "/tool/hx")
|
||||||
|
public class HxController {
|
||||||
|
|
||||||
|
private static final String HX_END_STRING = "_pingban_youban";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITbUserService tbUserService;
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@ApiOperation(value = "通过用户id,获取环信账号密码,只需要传id即可")
|
||||||
|
@PostMapping("/getByUserId")
|
||||||
|
public Result<HxResp> getByUserId(CommonReq commonReq){
|
||||||
|
TbUser user = tbUserService.getById(commonReq.getId());
|
||||||
|
if(user == null){
|
||||||
|
return Result.error("用户不存在!");
|
||||||
|
}
|
||||||
|
HxResp hxResp = new HxResp();
|
||||||
|
hxResp.setUsername(String.valueOf(user.getId()));
|
||||||
|
hxResp.setPassword(DigestUtils.md5Hex(user.getId() + HX_END_STRING));
|
||||||
|
return Result.success(hxResp);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.ruoyi.web.response;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "环信加密后对象")
|
||||||
|
public class HxResp {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -298,6 +298,8 @@ public class ShiroConfig
|
||||||
filterChainDefinitionMap.put("/tool/sms/**", "anon");
|
filterChainDefinitionMap.put("/tool/sms/**", "anon");
|
||||||
// oss文件接口
|
// oss文件接口
|
||||||
filterChainDefinitionMap.put("/tool/oss/**", "anon");
|
filterChainDefinitionMap.put("/tool/oss/**", "anon");
|
||||||
|
// oss环信接口
|
||||||
|
filterChainDefinitionMap.put("/tool/hx/**", "anon");
|
||||||
// app登陆接口
|
// app登陆接口
|
||||||
filterChainDefinitionMap.put("/app/login/**", "anon");
|
filterChainDefinitionMap.put("/app/login/**", "anon");
|
||||||
// app用户接口
|
// app用户接口
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue