Commit 2f33b3a6 authored by 王向伟's avatar 王向伟

渠道和角色添加查询所有接口

parent aa16d15b
package cn.quantgroup.cashloanflowboss.api.channel.controller;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfVo;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelModel;
import cn.quantgroup.cashloanflowboss.api.channel.service.ChannelConfService;
import cn.quantgroup.cashloanflowboss.component.security.annotiation.Security;
import cn.quantgroup.cashloanflowboss.core.annotation.channelrole.ChannelIdInit;
......@@ -11,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* Created with suntao on 2019/8/2
......@@ -83,4 +85,11 @@ public class ChannelConfController {
}
@GetMapping("/all")
public Result channelAll(){
List<ChannelModel> all = channelConfService.getAll();
return Result.buildSuccess(all);
}
}
package cn.quantgroup.cashloanflowboss.api.channel.model;
import lombok.Data;
/**
* @author Wang Xiangwei
* @version 2020/3/6
*/
@Data
public class ChannelModel {
private Long id;
private String name;
}
......@@ -2,8 +2,11 @@ package cn.quantgroup.cashloanflowboss.api.channel.service;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfVo;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelListModel;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelModel;
import org.springframework.data.domain.Page;
import java.util.List;
/**
* function:
* date: 2019/9/16
......@@ -17,4 +20,6 @@ public interface ChannelConfService {
ChannelConfVo getChannelConf(Long channelId);
Boolean editChannelConfInfo(ChannelConfVo confVo);
List<ChannelModel> getAll();
}
package cn.quantgroup.cashloanflowboss.api.channel.service;
import cn.quantgroup.cashloanflowboss.api.channel.entity.ChannelConf;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfAddModel;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfBaseModel;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfVo;
import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelListModel;
import cn.quantgroup.cashloanflowboss.api.channel.model.*;
import cn.quantgroup.cashloanflowboss.api.channel.repository.ChannelConfRepository;
import cn.quantgroup.cashloanflowboss.api.channel.util.ChannelConfUtil;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelApplyInfoStrategy;
......@@ -20,6 +17,7 @@ import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -143,4 +141,20 @@ public class ChannelConfServiceImpl implements ChannelConfService {
return true;
}
@Override
public List<ChannelModel> getAll() {
List<ClfChannelConfiguration> all = clfCenterService.findAll();
List<ChannelModel> channelModelList = new ArrayList<>(all.size());
all.forEach(e->{
ChannelModel model = new ChannelModel();
model.setId(e.getId());
model.setName(e.getChannelName());
channelModelList.add(model);
});
return channelModelList;
}
}
package cn.quantgroup.cashloanflowboss.api.role.controller;
import cn.quantgroup.cashloanflowboss.api.role.entity.Role;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleModel;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleModelVo;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleQueryModel;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleVO;
......@@ -12,6 +13,7 @@ import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* function:
......@@ -53,5 +55,9 @@ public class RoleController {
return roleService.modifyRole(roleModelVo);
}
@GetMapping("/all")
public Result<List<RoleModel>> getAll(){
return roleService.getAll();
}
}
package cn.quantgroup.cashloanflowboss.api.role.model;
import lombok.Data;
/**
* @author Wang Xiangwei
* @version 2020/3/6
*/
@Data
public class RoleModel {
private Long id;
private String name;
}
package cn.quantgroup.cashloanflowboss.api.role.service;
import cn.quantgroup.cashloanflowboss.api.role.entity.Role;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleModel;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleModelVo;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleQueryModel;
import cn.quantgroup.cashloanflowboss.core.base.Result;
import org.springframework.data.domain.Page;
import java.util.List;
/**
* @author Wang Xiangwei
* @version 2020/3/2
......@@ -20,4 +23,6 @@ public interface RoleService {
Result<Boolean> deleteRole(Long roleId);
Result<List<RoleModel>> getAll();
}
......@@ -3,6 +3,7 @@ package cn.quantgroup.cashloanflowboss.api.role.service;
import cn.quantgroup.cashloanflowboss.api.permissionmodule.entity.Permission;
import cn.quantgroup.cashloanflowboss.api.permissionmodule.repository.PermissionRepository;
import cn.quantgroup.cashloanflowboss.api.role.entity.Role;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleModel;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleModelVo;
import cn.quantgroup.cashloanflowboss.api.role.model.RoleQueryModel;
import cn.quantgroup.cashloanflowboss.api.role.repository.RoleRepository;
......@@ -154,4 +155,19 @@ public class RoleServiceImpl implements RoleService {
return Result.buildSuccess(true);
}
@Override
public Result<List<RoleModel>> getAll() {
List<Role> all = roleRepository.findAll();
List<RoleModel> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(all)){
all.forEach(e->{
RoleModel model = new RoleModel();
model.setId(e.getId());
model.setName(e.getName());
list.add(model);
});
}
return Result.buildSuccess(list);
}
}
......@@ -41,4 +41,7 @@ public interface CLFCenterService {
ChannelApplyInfoStrategy findChannelApplyInfoStrategyByChannelId(Long channelId);
void saveChannelApplyInfoStrategy(ChannelApplyInfoStrategy channelApplyInfoStrategy);
List<ClfChannelConfiguration> findAll();
}
......@@ -155,4 +155,14 @@ public class CLFCenterServiceImpl implements CLFCenterService {
public void saveChannelApplyInfoStrategy(ChannelApplyInfoStrategy channelApplyInfoStrategy) {
channelApplyInfoStrategyRepository.saveAndFlush(channelApplyInfoStrategy);
}
@Override
public List<ClfChannelConfiguration> findAll() {
Iterable<ClfChannelConfiguration> all = clfChannelConfigurationRepository.findAll();
List<ClfChannelConfiguration> list = new ArrayList<>();
if(all != null){
all.forEach(e->list.add(e));
}
return list;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment