1、swagger接口文档
parent
5e59bec0dc
commit
22826be87b
@ -0,0 +1,139 @@
|
||||
package com.ibeetl.admin.core.web.query;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CustomFilterByLcUser {
|
||||
|
||||
@JsonProperty("Id")
|
||||
private Integer Id;
|
||||
|
||||
@JsonProperty("Id2")
|
||||
private Integer Id2;
|
||||
@JsonProperty("IdList")
|
||||
private List<Integer> IdList;
|
||||
@JsonProperty("Id2List")
|
||||
private List<Integer> Id2List;
|
||||
@JsonProperty("TypeId")
|
||||
private Integer TypeId;
|
||||
@JsonProperty("UserId")
|
||||
private Integer UserId;
|
||||
@JsonProperty("StudentId")
|
||||
private Integer StudentId;
|
||||
@JsonProperty("KeyWord")
|
||||
private String Keyword;
|
||||
@JsonProperty("KeyWord2")
|
||||
private String Keyword2;
|
||||
@JsonProperty("KeyWord1Ex")
|
||||
private boolean Keyword1Ex;
|
||||
@JsonProperty("StatusId")
|
||||
private Integer StatusId;
|
||||
@JsonProperty("SortName")
|
||||
private String SortName;
|
||||
@JsonProperty("SortWay")
|
||||
private Boolean SortWay;
|
||||
public Integer getId() {
|
||||
return Id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public Integer getId2() {
|
||||
return Id2;
|
||||
}
|
||||
|
||||
public void setId2(Integer id2) {
|
||||
Id2 = id2;
|
||||
}
|
||||
|
||||
public List<Integer> getIdList() {
|
||||
return IdList;
|
||||
}
|
||||
|
||||
public void setIdList(List<Integer> idList) {
|
||||
IdList = idList;
|
||||
}
|
||||
|
||||
public List<Integer> getId2List() {
|
||||
return Id2List;
|
||||
}
|
||||
|
||||
public void setId2List(List<Integer> id2List) {
|
||||
Id2List = id2List;
|
||||
}
|
||||
|
||||
public Integer getTypeId() {
|
||||
return TypeId;
|
||||
}
|
||||
|
||||
public void setTypeId(Integer typeId) {
|
||||
TypeId = typeId;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return UserId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
UserId = userId;
|
||||
}
|
||||
|
||||
public Integer getStudentId() {
|
||||
return StudentId;
|
||||
}
|
||||
|
||||
public void setStudentId(Integer studentId) {
|
||||
StudentId = studentId;
|
||||
}
|
||||
|
||||
public String getKeyword() {
|
||||
return Keyword;
|
||||
}
|
||||
|
||||
public void setKeyword(String keyword) {
|
||||
Keyword = keyword;
|
||||
}
|
||||
|
||||
public String getKeyword2() {
|
||||
return Keyword2;
|
||||
}
|
||||
|
||||
public void setKeyword2(String keyword2) {
|
||||
Keyword2 = keyword2;
|
||||
}
|
||||
|
||||
public boolean isKeyword1Ex() {
|
||||
return Keyword1Ex;
|
||||
}
|
||||
|
||||
public void setKeyword1Ex(boolean keyword1Ex) {
|
||||
Keyword1Ex = keyword1Ex;
|
||||
}
|
||||
|
||||
public Integer getStatusId() {
|
||||
return StatusId;
|
||||
}
|
||||
|
||||
public void setStatusId(Integer statusId) {
|
||||
StatusId = statusId;
|
||||
}
|
||||
|
||||
public String getSortName() {
|
||||
return SortName;
|
||||
}
|
||||
|
||||
public void setSortName(String sortName) {
|
||||
SortName = sortName;
|
||||
}
|
||||
|
||||
public Boolean getSortWay() {
|
||||
return SortWay;
|
||||
}
|
||||
|
||||
public void setSortWay(Boolean sortWay) {
|
||||
SortWay = sortWay;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.ibeetl.jlw.dao;
|
||||
|
||||
import com.ibeetl.jlw.entity.LogoInfo;
|
||||
import com.ibeetl.jlw.entity.ResourcesApplicationCourse;
|
||||
import com.ibeetl.jlw.entity.SchoolClass;
|
||||
import com.ibeetl.jlw.web.query.LogoInfoQuery;
|
||||
import com.ibeetl.jlw.web.query.SchoolClassQuery;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.beetl.sql.mapper.BaseMapper;
|
||||
import org.beetl.sql.mapper.annotation.SqlResource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Repository
|
||||
@SqlResource("jlw.logoInfo")
|
||||
public interface LogoInfoDao extends BaseMapper<LogoInfo> {
|
||||
|
||||
|
||||
LogoInfo findById(Long id);
|
||||
|
||||
LogoInfo findByApplicationId(Long applicationId);
|
||||
|
||||
LogoInfo findByApplicationIdAndSchoolId(Long applicationId,Long schoolId);
|
||||
|
||||
|
||||
PageQuery<LogoInfo> queryByCondition(PageQuery query);
|
||||
|
||||
|
||||
List<LogoInfo> getValuesByQueryNotWithPermission(LogoInfoQuery logoInfoQuery);
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.ibeetl.jlw.entity;
|
||||
|
||||
|
||||
import cn.jlw.validate.ValidateConfig;
|
||||
import com.ibeetl.admin.core.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.beetl.sql.annotation.entity.AutoID;
|
||||
import org.beetl.sql.annotation.entity.InsertIgnore;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
public class LogoInfo extends BaseEntity {
|
||||
|
||||
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
|
||||
// @SeqID(name = ORACLE_CORE_SEQ_NAME)
|
||||
@AutoID
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("应用id")
|
||||
private Long applicationId;
|
||||
@ApiModelProperty("应用名称")
|
||||
private String applicationName;
|
||||
|
||||
@ApiModelProperty("logo路径")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("学校id")
|
||||
private Long schoolId;
|
||||
|
||||
@ApiModelProperty("底部版权信息")
|
||||
private String copyright;
|
||||
|
||||
@ApiModelProperty("创建人id")
|
||||
private Long createId;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
private String createName;
|
||||
@ApiModelProperty("学校名称")
|
||||
private String schoolName;
|
||||
/**
|
||||
* 新增时间
|
||||
*/
|
||||
@InsertIgnore
|
||||
private Date addTime;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
public void setApplicationId(Long applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public Long getSchoolId() {
|
||||
return schoolId;
|
||||
}
|
||||
|
||||
public void setSchoolId(Long schoolId) {
|
||||
this.schoolId = schoolId;
|
||||
}
|
||||
|
||||
public Date getAddTime() {
|
||||
return addTime;
|
||||
}
|
||||
|
||||
public void setAddTime(Date addTime) {
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public String getCopyright() {
|
||||
return copyright;
|
||||
}
|
||||
|
||||
public void setCopyright(String copyright) {
|
||||
this.copyright = copyright;
|
||||
}
|
||||
|
||||
public Long getCreateId() {
|
||||
return createId;
|
||||
}
|
||||
|
||||
public void setCreateId(Long createId) {
|
||||
this.createId = createId;
|
||||
}
|
||||
|
||||
public String getCreateName() {
|
||||
return createName;
|
||||
}
|
||||
|
||||
public void setCreateName(String createName) {
|
||||
this.createName = createName;
|
||||
}
|
||||
|
||||
public String getApplicationName() {
|
||||
return applicationName;
|
||||
}
|
||||
|
||||
public void setApplicationName(String applicationName) {
|
||||
this.applicationName = applicationName;
|
||||
}
|
||||
|
||||
public String getSchoolName() {
|
||||
return schoolName;
|
||||
}
|
||||
|
||||
public void setSchoolName(String schoolName) {
|
||||
this.schoolName = schoolName;
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.ibeetl.jlw.service;
|
||||
|
||||
|
||||
import com.ibeetl.admin.core.service.CoreBaseService;
|
||||
import com.ibeetl.jlw.dao.LogoInfoDao;
|
||||
import com.ibeetl.jlw.entity.LogoInfo;
|
||||
import com.ibeetl.jlw.entity.ResourcesApplication;
|
||||
import com.ibeetl.jlw.entity.UniversitiesColleges;
|
||||
import com.ibeetl.jlw.entity.vo.LogoInfoVO;
|
||||
import com.ibeetl.jlw.web.query.LogoInfoQuery;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class LogoInfoService extends CoreBaseService<LogoInfo> {
|
||||
|
||||
@Autowired
|
||||
LogoInfoDao logoInfoDao;
|
||||
@Autowired
|
||||
UniversitiesCollegesService universitiesCollegesService;
|
||||
|
||||
|
||||
public LogoInfo insert(LogoInfoVO vo) {
|
||||
LogoInfo logoInfo1 = findByApplicationIdAndSchoolId(vo.getApplicationId(), vo.getSchoolId());
|
||||
Assert.isNull(logoInfo1, "该应用已配置logo信息");
|
||||
LogoInfo logoInfo = new LogoInfo();
|
||||
logoInfo.setApplicationId(vo.getApplicationId());
|
||||
logoInfo.setPath(vo.getPath());
|
||||
logoInfo.setSchoolId(vo.getSchoolId());
|
||||
if (vo.getSchoolId() != null) {
|
||||
UniversitiesColleges universitiesColleges = universitiesCollegesService.getById(vo.getSchoolId());
|
||||
logoInfo.setSchoolName(universitiesColleges.getUniversitiesCollegesName());
|
||||
}
|
||||
logoInfo.setCopyright(vo.getCopyright());
|
||||
logoInfo.setApplicationName(vo.getApplicationName());
|
||||
logoInfoDao.insert(logoInfo);
|
||||
return logoInfo;
|
||||
}
|
||||
|
||||
public boolean deleteById(Long id) {
|
||||
LogoInfo info = findById(id);
|
||||
if (info != null) {
|
||||
logoInfoDao.deleteById(id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public LogoInfo findById(Long id) {
|
||||
return logoInfoDao.findById(id);
|
||||
}
|
||||
|
||||
public LogoInfo update(LogoInfoVO vo) {
|
||||
Assert.notNull(vo.getId(), "ID不能为空");
|
||||
LogoInfo info = findById(vo.getId());
|
||||
if (vo.getApplicationId() != null) {
|
||||
info.setApplicationId(vo.getApplicationId());
|
||||
}
|
||||
if (vo.getPath() != null) {
|
||||
info.setPath(vo.getPath());
|
||||
}
|
||||
if (vo.getSchoolId() != null) {
|
||||
info.setSchoolId(vo.getSchoolId());
|
||||
if (vo.getSchoolId() != null) {
|
||||
UniversitiesColleges universitiesColleges = universitiesCollegesService.getById(vo.getSchoolId());
|
||||
info.setSchoolName(universitiesColleges.getUniversitiesCollegesName());
|
||||
}
|
||||
}
|
||||
if (vo.getCopyright() != null) {
|
||||
info.setCopyright(vo.getCopyright());
|
||||
}
|
||||
if (vo.getApplicationName() != null) {
|
||||
info.setApplicationName(vo.getApplicationName());
|
||||
}
|
||||
logoInfoDao.updateTemplateById(info);
|
||||
return info;
|
||||
}
|
||||
|
||||
//查询默认的logo图片设置和底部版权信息
|
||||
public LogoInfo findByApplicationId(Long applicationId) {
|
||||
return logoInfoDao.findByApplicationId(applicationId);
|
||||
}
|
||||
|
||||
public LogoInfo findByApplicationIdAndSchoolId(Long applicationId, Long schoolId) {
|
||||
return logoInfoDao.findByApplicationIdAndSchoolId(applicationId, schoolId);
|
||||
}
|
||||
|
||||
public PageQuery<LogoInfo> queryByCondition(PageQuery query) {
|
||||
PageQuery ret = logoInfoDao.queryByCondition(query);
|
||||
queryListAfter(ret.getList());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<LogoInfo> getValuesByQueryNotWithPermission(LogoInfoQuery logoInfoQuery) {
|
||||
return logoInfoDao.getValuesByQueryNotWithPermission(logoInfoQuery);
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.ibeetl.jlw.web;
|
||||
|
||||
|
||||
import cn.jlw.Interceptor.SCoreUser;
|
||||
import com.ibeetl.admin.core.annotation.Function;
|
||||
import com.ibeetl.admin.core.entity.CoreUser;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import com.ibeetl.jlw.entity.LogoInfo;
|
||||
import com.ibeetl.jlw.service.LogoInfoService;
|
||||
import com.ibeetl.jlw.web.query.LogoInfoQuery;
|
||||
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
|
||||
import com.ibeetl.jlw.web.query.SchoolClassQuery;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
||||
|
||||
@Controller
|
||||
@Api(tags = {"资源管理 - 子应用Logo和底部版权信息管理"})
|
||||
public class LogoInfoController extends BaseController{
|
||||
|
||||
|
||||
private static final String MODEL = "/jlw/logoInfo";
|
||||
private static final String API = "/api/logoInfo";
|
||||
private final Log log = LogFactory.getLog(this.getClass());
|
||||
@Autowired
|
||||
private LogoInfoService logoInfoService;
|
||||
|
||||
|
||||
@GetMapping(API + "/getList.do")
|
||||
@ResponseBody
|
||||
@ApiOperation("分页列表")
|
||||
public JsonResult<List<LogoInfo>> getList(LogoInfoQuery condition) {
|
||||
CoreUser coreUser = getUser();
|
||||
List<LogoInfo> list = logoInfoService.getValuesByQueryNotWithPermission(condition);
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/list.json")
|
||||
@Function("logoInfo.query")
|
||||
@ResponseBody
|
||||
@ApiOperation("分页列表")
|
||||
public JsonResult<PageQuery> list(LogoInfoQuery condition, @SCoreUser CoreUser coreUser) {
|
||||
PageQuery page = condition.getPageQuery();
|
||||
logoInfoService.queryByCondition(page);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("count", page.getTotalRow());
|
||||
map.put("data", page.getList());
|
||||
map.put("beTeacher", null != coreUser && "JT_S_02".equals(coreUser.getJobType1()) ? 1 : 2);//是否是教师 1是 2否
|
||||
|
||||
return JsonResult.successMap(map);
|
||||
|
||||
}
|
||||
/* 后台页面 */
|
||||
|
||||
@GetMapping(MODEL + "/index.do")
|
||||
@Function("logoInfo.query")
|
||||
@ResponseBody
|
||||
@ApiOperation("后台系统管理界面")
|
||||
public ModelAndView index(@SCoreUser CoreUser coreUser) {
|
||||
ModelAndView view = new ModelAndView("/jlw/logoInfo/index.html");
|
||||
view.addObject("search", LogoInfoQuery.class.getName());
|
||||
view.addObject("beTeacher", null != coreUser && "JT_S_02".equals(coreUser.getJobType1()) ? 1 : 2);//是否是教师 1是 2否
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.ibeetl.jlw.web.query;
|
||||
|
||||
import com.ibeetl.admin.core.annotation.Query;
|
||||
import com.ibeetl.admin.core.web.query.PageParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class LogoInfoQuery extends PageParam {
|
||||
|
||||
@Query(name = "应用名称", display = true)
|
||||
@ApiModelProperty("应用名称")
|
||||
private String applicationName;
|
||||
|
||||
@Query(name = "学校名称", display = true)
|
||||
@ApiModelProperty("学校名称")
|
||||
private String schoolName;
|
||||
|
||||
|
||||
public String getApplicationName() {
|
||||
return applicationName;
|
||||
}
|
||||
|
||||
public void setApplicationName(String applicationName) {
|
||||
this.applicationName = applicationName;
|
||||
}
|
||||
|
||||
public String getSchoolName() {
|
||||
return schoolName;
|
||||
}
|
||||
|
||||
public void setSchoolName(String schoolName) {
|
||||
this.schoolName = schoolName;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue