|
|
|
@ -1,11 +1,9 @@
|
|
|
|
|
package com.java3y.austin.web.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.java3y.austin.common.constant.AustinConstant;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.java3y.austin.common.vo.BasicResultVO;
|
|
|
|
|
import com.java3y.austin.support.dao.ChannelAccountDao;
|
|
|
|
|
import com.java3y.austin.support.domain.ChannelAccount;
|
|
|
|
|
import com.java3y.austin.support.domain.MessageTemplate;
|
|
|
|
|
import com.java3y.austin.web.service.ChannelAccountService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
@ -13,6 +11,10 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 渠道账号管理接口
|
|
|
|
|
*
|
|
|
|
@ -21,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/account")
|
|
|
|
|
@Api("素材管理接口")
|
|
|
|
|
@Api("渠道账号管理接口")
|
|
|
|
|
@CrossOrigin(origins = "http://localhost:3000", allowCredentials = "true", allowedHeaders = "*")
|
|
|
|
|
public class ChannelAccountController {
|
|
|
|
|
|
|
|
|
@ -42,10 +44,34 @@ public class ChannelAccountController {
|
|
|
|
|
/**
|
|
|
|
|
* 根据渠道标识查询渠道账号相关的信息
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/query")
|
|
|
|
|
@ApiOperation("/保存数据")
|
|
|
|
|
@GetMapping("/queryByChannelType")
|
|
|
|
|
@ApiOperation("/根据渠道标识查询相关的记录")
|
|
|
|
|
public BasicResultVO query(Integer channelType) {
|
|
|
|
|
return BasicResultVO.success(channelAccountService.queryByChannelType(channelType));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 所有的渠道账号信息
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
@ApiOperation("/渠道账号列表信息")
|
|
|
|
|
public BasicResultVO list() {
|
|
|
|
|
return BasicResultVO.success(channelAccountService.list());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据Id删除
|
|
|
|
|
* id多个用逗号分隔开
|
|
|
|
|
*/
|
|
|
|
|
@DeleteMapping("delete/{id}")
|
|
|
|
|
@ApiOperation("/根据Ids删除")
|
|
|
|
|
public BasicResultVO deleteByIds(@PathVariable("id") String id) {
|
|
|
|
|
if (StrUtil.isNotBlank(id)) {
|
|
|
|
|
List<Long> idList = Arrays.stream(id.split(StrUtil.COMMA)).map(s -> Long.valueOf(s)).collect(Collectors.toList());
|
|
|
|
|
channelAccountService.deleteByIds(idList);
|
|
|
|
|
return BasicResultVO.success();
|
|
|
|
|
}
|
|
|
|
|
return BasicResultVO.fail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|