Commit d0037d5e by 吴迪

修改bug 05.16-05.18

parent dd142b7c
......@@ -5,15 +5,20 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.PartnersEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -139,6 +144,11 @@ public class CasesController extends AbstractController {
return R.error(e.getMessage());
}
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 信息
*/
......@@ -147,6 +157,26 @@ public class CasesController extends AbstractController {
public R getDetailInfo(@RequestBody Map<String, String> params){
CasesEntity casesEntity = casesService.getById(params.get("id"));
if (casesEntity == null) {
return R.error("没有可显示的内容");
}
if (params.get("token") != null && StringUtils.isNotBlank(params.get("token").toString())) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", params.get("token").toString());
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (casesEntity.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", casesEntity);
}
......
......@@ -12,12 +12,17 @@ import io.office.common.utils.R;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.IndexCarouselManageEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.PictureEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.IndexCarouselManageParams;
import io.office.modules.manage.service.IndexCarouselManageService;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -31,7 +36,7 @@ import org.springframework.web.bind.annotation.*;
@RestController
@Slf4j
@RequestMapping("/indexCarouselManage")
public class IndexCarouselManageController extends AbstractController {
public class IndexCarouselManageController extends AbstractController {
@Autowired
private IndexCarouselManageService indexCarouselManageService;
......@@ -40,10 +45,10 @@ public class IndexCarouselManageController extends AbstractController {
*/
@RequestMapping("/list")
@RequiresPermissions("manage:indexcarouselmanage:list")
public R list(@RequestBody IndexCarouselManageParams indexCarouselManage){
public R list(@RequestBody IndexCarouselManageParams indexCarouselManage) {
Page<IndexCarouselManageEntity> page = this.indexCarouselManageService.selectIndexCarouselManageList(indexCarouselManage,
new Page(indexCarouselManage.getPage(),indexCarouselManage.getLimit()));
PageUtils pageUtils = new PageUtils(page);
new Page(indexCarouselManage.getPage(), indexCarouselManage.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
......@@ -54,21 +59,45 @@ public class IndexCarouselManageController extends AbstractController {
@Login
@RequestMapping("/info/{id}")
@RequiresPermissions("manage:indexcarouselmanage:info")
public R info(@PathVariable("id") Integer id){
IndexCarouselManageEntity indexCarouselManage = indexCarouselManageService.getById(id);
public R info(@PathVariable("id") Integer id) {
IndexCarouselManageEntity indexCarouselManage = indexCarouselManageService.getById(id);
return R.ok().put("indexCarouselManage", indexCarouselManage);
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 信息
*/
@Login
@RequestMapping("/api/info/{id}")
@RequestMapping({"/api/info/{id}", "/api/info/{id}/{token}"})
// @RequiresPermissions("manage:indexcarouselmanage:info")
public R apiInfo(@PathVariable("id") Integer id){
public R apiInfo(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) {
IndexCarouselManageEntity indexCarouselManage = indexCarouselManageService.getById(id);
if (indexCarouselManage == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (indexCarouselManage.getCheckflagIndex() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("indexCarouselManage", indexCarouselManage);
}
......@@ -81,9 +110,9 @@ public class IndexCarouselManageController extends AbstractController {
@SysLog("保存首页轮播[indexcarouselmanage]")
@RequestMapping("/save")
@RequiresPermissions("manage:indexcarouselmanage:save")
public R save(@RequestBody IndexCarouselManageEntity indexCarouselManage){
public R save(@RequestBody IndexCarouselManageEntity indexCarouselManage) {
try {
R r = this.indexCarouselManageService.insertIndexCarouselManage(indexCarouselManage,getUser());
R r = this.indexCarouselManageService.insertIndexCarouselManage(indexCarouselManage, getUser());
return r;
} catch (Exception e) {
log.error("indexCarouselManage save error:", e);
......@@ -98,9 +127,9 @@ public class IndexCarouselManageController extends AbstractController {
@SysLog("修改首页轮播[indexcarouselmanage]")
@RequestMapping("/update")
@RequiresPermissions("manage:indexcarouselmanage:update")
public R update(@RequestBody IndexCarouselManageEntity indexCarouselManage){
public R update(@RequestBody IndexCarouselManageEntity indexCarouselManage) {
try {
R r = this.indexCarouselManageService.updateIndexCarouselManage(indexCarouselManage,getUser());
R r = this.indexCarouselManageService.updateIndexCarouselManage(indexCarouselManage, getUser());
return r;
} catch (Exception e) {
log.error("indexCarouselManage update error:", e);
......@@ -115,15 +144,16 @@ public class IndexCarouselManageController extends AbstractController {
@SysLog("删除首页轮播[indexcarouselmanage]")
@RequestMapping("/delete")
@RequiresPermissions("manage:indexcarouselmanage:delete")
public R delete(@RequestBody Integer[] ids){
try{
R r = indexCarouselManageService.deleteIndexCarouselManage(Arrays.asList(ids),getUser());
public R delete(@RequestBody Integer[] ids) {
try {
R r = indexCarouselManageService.deleteIndexCarouselManage(Arrays.asList(ids), getUser());
return r;
}catch (Exception e){
log.error("indexCarouselManage delete error:",e);
} catch (Exception e) {
log.error("indexCarouselManage delete error:", e);
return R.error(e.getMessage());
}
}
/**
* 审核
*/
......@@ -133,7 +163,7 @@ public class IndexCarouselManageController extends AbstractController {
@RequiresPermissions("manage:indexcarouselmanage:check")
public R verify(@RequestBody IndexCarouselManageEntity indexCarouselManage) {
try {
R r = this.indexCarouselManageService.verifyIndexCarouselManage(indexCarouselManage,getUser());
R r = this.indexCarouselManageService.verifyIndexCarouselManage(indexCarouselManage, getUser());
return r;
} catch (Exception e) {
log.error("verifyIndexCarouselManage error:", e);
......@@ -149,8 +179,8 @@ public class IndexCarouselManageController extends AbstractController {
public R updateIsShow(@RequestBody IndexCarouselManageEntity indexCarouselManage) {
try {
QueryWrapper<IndexCarouselManageEntity> updateQueryWrapper = new QueryWrapper();
updateQueryWrapper.eq("id",indexCarouselManage.getId());
indexCarouselManageService.update(indexCarouselManage,updateQueryWrapper);
updateQueryWrapper.eq("id", indexCarouselManage.getId());
indexCarouselManageService.update(indexCarouselManage, updateQueryWrapper);
return R.ok();
} catch (Exception e) {
log.error("verifyIndexCarouselManage error:", e);
......@@ -160,10 +190,6 @@ public class IndexCarouselManageController extends AbstractController {
}
@Login
@PostMapping("/api/bigImages")
// @RequiresPermissions("manage:indexcarouselmanage:bigImages")
......@@ -171,9 +197,9 @@ public class IndexCarouselManageController extends AbstractController {
try {
QueryWrapper<IndexCarouselManageEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("classnum","大轮播");
newsEntityQueryWrapper.eq("checkflag_index","1");
newsEntityQueryWrapper.gt("levels",0);
newsEntityQueryWrapper.eq("classnum", "大轮播");
newsEntityQueryWrapper.eq("checkflag_index", "1");
newsEntityQueryWrapper.gt("levels", 0);
newsEntityQueryWrapper.orderByDesc("levels_index");
List<IndexCarouselManageEntity> list = indexCarouselManageService.list(newsEntityQueryWrapper);
return R.ok().put("data", list);
......@@ -190,9 +216,9 @@ public class IndexCarouselManageController extends AbstractController {
try {
QueryWrapper<IndexCarouselManageEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("classnum","小轮播");
newsEntityQueryWrapper.eq("checkflag_index","1");
newsEntityQueryWrapper.gt("levels",0);
newsEntityQueryWrapper.eq("classnum", "小轮播");
newsEntityQueryWrapper.eq("checkflag_index", "1");
newsEntityQueryWrapper.gt("levels", 0);
newsEntityQueryWrapper.orderByDesc("levels_index");
List<IndexCarouselManageEntity> list = indexCarouselManageService.list(newsEntityQueryWrapper);
return R.ok().put("data", list);
......@@ -207,10 +233,10 @@ public class IndexCarouselManageController extends AbstractController {
* 列表
*/
@RequestMapping("/indexCarouselManageList")
public R indexCarouselManageList(@RequestBody IndexCarouselManageParams indexCarouselManage){
public R indexCarouselManageList(@RequestBody IndexCarouselManageParams indexCarouselManage) {
Page<IndexCarouselManageEntity> page = this.indexCarouselManageService.indexCarouselManageList(indexCarouselManage,
new Page(indexCarouselManage.getPage(),indexCarouselManage.getLimit()));
PageUtils pageUtils = new PageUtils(page);
new Page(indexCarouselManage.getPage(), indexCarouselManage.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
......
......@@ -118,7 +118,7 @@ public class KnowledgeinfoController extends AbstractController {
@RequestMapping("/verify")
@RequiresPermissions("manage:knowledgeinfo:check")
public R verify(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfo.setAuditor(getUser().getUsername());
//knowledgeinfo.setAuditor(getUser().getUsername());
QueryWrapper<KnowledgeinfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("knowledgeinfoid",knowledgeinfo.getKnowledgeinfoid());
knowledgeinfoService.update(knowledgeinfo,queryWrapper);
......
......@@ -115,9 +115,9 @@ public class LogisticsController extends AbstractController {
@RequiresPermissions("manage:logistics:check")
public R verifyMedical(@RequestBody LogisticsEntity logistics){
String username = getUser().getUsername();
logistics.setEditor(username);
logistics.setLasteditor(username);
logistics.setUpdatetime(new Date());
//logistics.setEditor(username);
//logistics.setLasteditor(username);
// logistics.setUpdatetime(new Date());
logistics.setCheckname(username);
logistics.setChecktime(new Date());
QueryWrapper<LogisticsEntity> queryWrapper = new QueryWrapper<>();
......
......@@ -6,13 +6,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.service.MedicalService;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.manage.utils.IdKeysConstant;
import io.office.modules.manage.utils.IdWorkerUtils;
import io.office.modules.sys.controller.AbstractController;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -85,7 +89,7 @@ public class MedicalController extends AbstractController {
@RequiresPermissions("manage:medical:update")
public R update(@RequestBody MedicalEntity medical) {
String username = getUser().getUsername();
medical.setEditor(username);
//medical.setEditor(username);
medical.setLasteditor(username);
medical.setUpdatetime(new Date());
dealMedicalTypeId(medical.getType(),medical);
......@@ -101,7 +105,24 @@ public class MedicalController extends AbstractController {
@RequestMapping("/delete")
@RequiresPermissions("manage:medical:delete")
public R delete(@RequestBody List<String> ids) {
medicalService.removeByIds(ids);
if(CollectionUtils.isNotEmpty(ids)) {
for (String id : ids) {
MedicalEntity medicalServiceById = medicalService.getById(id);
if(medicalServiceById.getLevel()==0) {
return R.error("当前级别为0不能删除!");
}
}
}
MedicalEntity medical = new MedicalEntity();
String username = getUser().getUsername();
// medical.setEditor(username);
medical.setLasteditor(username);
medical.setUpdatetime(new Date());
medical.setLevel(0);
QueryWrapper<MedicalEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id", ids);
medicalService.update(medical, queryWrapper);
return R.ok("删除成功!");
}
......@@ -117,9 +138,9 @@ public class MedicalController extends AbstractController {
@RequiresPermissions("manage:medical:check")
public R verifyMedical(@RequestBody MedicalEntity medical) {
String username = getUser().getUsername();
medical.setEditor(username);
medical.setLasteditor(username);
medical.setUpdatetime(new Date());
// medical.setEditor(username);
// medical.setLasteditor(username);
// medical.setUpdatetime(new Date());
medical.setCheckname(username);
medical.setChecktime(new Date());
QueryWrapper<MedicalEntity> queryWrapper = new QueryWrapper<>();
......@@ -155,12 +176,35 @@ public class MedicalController extends AbstractController {
queryWrapper.orderByDesc("releaseTime");
return R.ok().put("data", medicalService.list(queryWrapper));
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
@PostMapping("/api/getDetailById")
public R getDetailById(@RequestBody MedicalEntity medical) {
MedicalEntity medicalEntity = medicalService.getById(medical.getId());
if (medicalEntity == null) {
return R.error("没有可显示的内容");
}
if (medical.getToken() != null && org.apache.commons.lang.StringUtils.isNotBlank(medical.getToken())) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", medical.getToken() );
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (medicalEntity.getStatus()!=null && !medicalEntity.getStatus().equals("1")) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", medicalService.getById(medical.getId()));
return R.ok().put("data", medicalEntity);
}
......
......@@ -16,8 +16,12 @@ import io.office.modules.manage.service.*;
import io.office.modules.manage.vo.response.SearchVo;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.aspectj.apache.bcel.classfile.Module;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -41,6 +45,11 @@ public class NewsController extends AbstractController {
private NewsService newsService;
@Autowired
private NewsclassService newsclassService;
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 列表
......@@ -48,8 +57,7 @@ public class NewsController extends AbstractController {
@PostMapping("/list")
@RequiresPermissions("manage:news:list")
public R list(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.selectNewsList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.selectNewsList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
......@@ -126,6 +134,16 @@ public class NewsController extends AbstractController {
@RequiresPermissions("manage:news:delete")
public R delete(@RequestBody List<Long> ids) {
try {
if (CollectionUtils.isNotEmpty(ids)) {
for (long id : ids) {
NewsEntity newsServiceById = newsService.getById(id);
//MedicalEntity medicalServiceById = (MedicalEntity) newsServiceById;
if (newsServiceById.getLevels() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.newsService.deleteNews(ids, getUser());
return r;
} catch (Exception e) {
......@@ -174,8 +192,7 @@ public class NewsController extends AbstractController {
@PostMapping("/api/realTimeInfo")
// @RequiresPermissions("manage:news:list")
public R realTimeInfo(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.selectRealTimeInfo(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.selectRealTimeInfo(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -185,10 +202,29 @@ public class NewsController extends AbstractController {
*/
@Login
@GetMapping("/api/info/{id}")
@GetMapping({"/api/info/{id}", "/api/info/{id}/{token}"})
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R getDetail(@PathVariable("id") Integer id) {
public R getDetail(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) {
NewsEntity news = newsService.getById(id);
if (news == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (news.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", news);
}
......@@ -199,8 +235,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/industryApplication")
public R industryApplication(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.industryApplication(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.industryApplication(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -212,8 +247,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/medicalList")
public R medicalList(@RequestBody NewsParams newsParams) {
Page<MedicalEntity> page = this.newsService.medicalList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<MedicalEntity> page = this.newsService.medicalList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -239,8 +273,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/iotList")
public R iotList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.iotList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.iotList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -252,8 +285,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/otherList")
public R otherList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.otherList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.otherList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -264,8 +296,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/foodSafetyList")
public R foodSafetyList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.foodSafetyList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.foodSafetyList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -278,8 +309,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/logostocsList")
public R logostocsList(@RequestBody NewsParams newsParams) {
Page<LogisticsEntity> page = this.newsService.logostocsList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<LogisticsEntity> page = this.newsService.logostocsList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -304,8 +334,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/yydtList")
public R yydtList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.yydtList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.yydtList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -316,8 +345,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/spList")
public R spList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.spList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.spList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -328,8 +356,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/announceList")
public R announceList(@RequestBody NewsParams newsParams) {
Page<AnnounceEntity> page = this.newsService.announceList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<AnnounceEntity> page = this.newsService.announceList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -340,10 +367,30 @@ public class NewsController extends AbstractController {
@Autowired
AnnounceService announceService;
@Login
@GetMapping("/api/announInfo/{id}")
public R announInfo(@PathVariable("id") Integer id) {
@GetMapping({"/api/announInfo/{id}", "/api/announInfo/{id}/{token}"})
public R announInfo(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) {
AnnounceEntity announceEntity = this.announceService.getById(id);
if (announceEntity == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (announceEntity.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", announceEntity);
}
......@@ -353,8 +400,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/xgbzList")
public R xgbzList(@RequestBody NewsParams newsParams) {
Page<PolicyEntity> page = this.newsService.xgbzList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<PolicyEntity> page = this.newsService.xgbzList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -375,8 +421,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/zcfgList")
public R zcfgList(@RequestBody NewsParams newsParams) {
Page<PolicyEntity> page = this.newsService.zcfgList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<PolicyEntity> page = this.newsService.zcfgList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -439,9 +484,29 @@ public class NewsController extends AbstractController {
* 查看
*/
@Login
@GetMapping("/api/knowledgeinfo/{id}")
public R getInfo(@PathVariable("id") Integer id) {
@GetMapping({"/api/knowledgeinfo/{id}", "/api/knowledgeinfo/{id}/{token}"})
public R getInfo(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) {
KnowledgeinfoEntity retMap = this.knowledgeinfoService.getById(id);
if (retMap == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (retMap.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", retMap);
}
......@@ -461,8 +526,7 @@ public class NewsController extends AbstractController {
@Login
@PostMapping("/api/searchKnowledgePageList")
public R searchKnowledgePageList(@RequestBody NewsParams params) {
Page<List<Map<String, Object>>> page = this.newsService.searchKnowledgePageList(params,
new Page(params.getPage(), params.getLimit()));
Page<List<Map<String, Object>>> page = this.newsService.searchKnowledgePageList(params, new Page(params.getPage(), params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -540,9 +604,28 @@ public class NewsController extends AbstractController {
* 专题推荐
*/
@Login
@GetMapping("/api/newsTopicInfo/{id}")
public R newsTopicInfo(@PathVariable("id") String id) {
@GetMapping({"/api/newsTopicInfo/{id}", ",/api/newsTopicInfo/{id}/{token}"})
public R newsTopicInfo(@PathVariable("id") String id, @PathVariable(value = "token", required = false) String token) {
NewtopicEntity newtopic = newtopicService.getById(id);
if (newtopic == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (newtopic.getCheckflag() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", newtopic);
}
......@@ -560,9 +643,7 @@ public class NewsController extends AbstractController {
@RequestMapping("/api/getSearchInfo")
// @RequiresPermissions("manage:product:findPage")
public R getSearchInfo(@RequestBody Map<String, String> param) {
Page<SearchVo> pag = this.newsService.getSearchInfo(param.get("name") == null ? null : param.get("name"),param.get("type") == null ? null : param.get("type"),
new Page(Integer.valueOf(param.get("page")),
Integer.valueOf(param.get("size"))));
Page<SearchVo> pag = this.newsService.getSearchInfo(param.get("name") == null ? null : param.get("name"), param.get("type") == null ? null : param.get("type"), new Page(Integer.valueOf(param.get("page")), Integer.valueOf(param.get("size"))));
PageUtils pageUtils = new PageUtils(pag);
return R.ok().put("page", pageUtils);
}
......@@ -575,11 +656,11 @@ public class NewsController extends AbstractController {
QueryWrapper<NewsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.select("top 7 * ");
queryWrapper.gt("levels",0);
queryWrapper.eq("status",1);
queryWrapper.gt("levels", 0);
queryWrapper.eq("status", 1);
//.or().like("content","零售").or().like("content","商品二维码").or().like("content","全渠道")
queryWrapper.eq("classid","14").or().like("keyword","零售").or().like("keyword","全渠道").like("keyword","商品二维码");
queryWrapper.orderByDesc("levels ","id");
queryWrapper.eq("classid", "14").or().like("keyword", "零售").or().like("keyword", "全渠道").like("keyword", "商品二维码");
queryWrapper.orderByDesc("levels ", "id");
List<NewsEntity> lists = newsService.list(queryWrapper);
/*Page<NewsEntity> page = this.newsService.selectRealTimeInfo(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
......@@ -593,13 +674,12 @@ public class NewsController extends AbstractController {
public R retailList(@RequestBody Map<String, String> params) {
QueryWrapper<NewsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.gt("levels",0);
queryWrapper.eq("status",1);
queryWrapper.gt("levels", 0);
queryWrapper.eq("status", 1);
//or().like("content","零售").or().like("content","商品二维码").or().like("content","全渠道").
queryWrapper.eq("classid","14").or().like("keyword","零售").or().like("keyword","全渠道").like("keyword","商品二维码");
queryWrapper.orderByDesc("levels ","id");
Page page = newsService.page(new Page(Integer.valueOf(params.get("page")),
Integer.valueOf(params.get("size"))), queryWrapper);
queryWrapper.eq("classid", "14").or().like("keyword", "零售").or().like("keyword", "全渠道").like("keyword", "商品二维码");
queryWrapper.orderByDesc("levels ", "id");
Page page = newsService.page(new Page(Integer.valueOf(params.get("page")), Integer.valueOf(params.get("size"))), queryWrapper);
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -612,13 +692,12 @@ public class NewsController extends AbstractController {
public R retailCodeTop6List(@RequestBody Map<String, String> params) {
QueryWrapper<NewsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.gt("levels",0);
queryWrapper.eq("status",1);
queryWrapper.gt("levels", 0);
queryWrapper.eq("status", 1);
//or().like("content","零售").or().like("content","商品二维码").or().like("content","全渠道").
queryWrapper.eq("classid","14").or().like("keyword","商品二维码");
queryWrapper.orderByDesc("levels ","id");
Page page = newsService.page(new Page(Integer.valueOf(params.get("page")),
Integer.valueOf(params.get("size"))), queryWrapper);
queryWrapper.eq("classid", "14").or().like("keyword", "商品二维码");
queryWrapper.orderByDesc("levels ", "id");
Page page = newsService.page(new Page(Integer.valueOf(params.get("page")), Integer.valueOf(params.get("size"))), queryWrapper);
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -630,8 +709,7 @@ public class NewsController extends AbstractController {
@RequestMapping("/api/zhbdList")
// @RequiresPermissions("manage:product:findPage")
public R zhbdList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.zhbdList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.zhbdList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -643,8 +721,7 @@ public class NewsController extends AbstractController {
@RequestMapping("/api/bzkydtList")
// @RequiresPermissions("manage:product:findPage")
public R bzkydtList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.bzkydtList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.bzkydtList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -656,8 +733,7 @@ public class NewsController extends AbstractController {
@RequestMapping("/api/sdztList")
// @RequiresPermissions("manage:product:findPage")
public R sdztList(@RequestBody NewsParams newsParams) {
Page<NewtopicEntity> page = this.newsService.sdztList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewtopicEntity> page = this.newsService.sdztList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
......@@ -669,73 +745,92 @@ public class NewsController extends AbstractController {
@RequestMapping("/api/jcspList")
// @RequiresPermissions("manage:product:findPage")
public R jcspList(@RequestBody NewsParams newsParams) {
Page<NewsMovieEntity> page = this.newsService.jcspList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsMovieEntity> page = this.newsService.jcspList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
@Autowired
@Lazy
private NewsMovieService newsMovieService;
/**
*精彩视频详情
* 精彩视频详情
*/
@Login
/**
* 信息
*/
@RequestMapping("/api/jcspiInfo/{id}")
@RequestMapping({"/api/jcspiInfo/{id}", "/api/jcspiInfo/{id}/{token}"})
// @RequiresPermissions("manage:newsmovie:info")
public R jcspiInfo(@PathVariable("id") Integer id){
public R jcspiInfo(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) {
NewsMovieEntity newsMovie = newsMovieService.getById(id);
if (newsMovie == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (newsMovie.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", newsMovie);
}
/***********************************应用领域*********************************/
/**
*应用领域栏目接口
* 应用领域栏目接口
*/
@RequestMapping("/columnList")
// @RequiresPermissions("manage:newsmovie:info")
public R columnList(){
List<Map<String,Object>> retList = this.newsService.columnList();
public R columnList() {
List<Map<String, Object>> retList = this.newsService.columnList();
return R.ok().put("data", retList);
}
/**
*应用领域列表
* 应用领域列表
*/
@PostMapping("/yylyList")
//@RequiresPermissions("manage:news:list")
public R yylyList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.selectYylyList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
Page<NewsEntity> page = this.newsService.selectYylyList(newsParams, new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
/**
*首页党建文化
* 首页党建文化
*/
@RequestMapping("/api/sydjwhTop4")
// @RequiresPermissions("manage:newsmovie:info")
public R sydjwhTop4(){
List<Map<String,Object>> retList = this.newsService.sydjwhTop4();
public R sydjwhTop4() {
List<Map<String, Object>> retList = this.newsService.sydjwhTop4();
return R.ok().put("data", retList);
}
/**
*首页党建文化
* 首页党建文化
*/
@RequestMapping("/api/sydjwhTop1")
// @RequiresPermissions("manage:newsmovie:info")
public R sydjwhTop1(){
List<Map<String,Object>> retList = this.newsService.sydjwhTop1();
public R sydjwhTop1() {
List<Map<String, Object>> retList = this.newsService.sydjwhTop1();
return R.ok().put("data", retList);
}
}
......@@ -121,7 +121,7 @@ public class NewsMovieController extends AbstractController {
SysUserEntity user = getUser();
NewsMovieEntity newsMovieEntity = new NewsMovieEntity();
newsMovieEntity.setAuditor(user.getUsername());
// newsMovieEntity.setAuditor(user.getUsername());
BeanUtils.copyProperties(newsMovieEntityVo, newsMovieEntity);
QueryWrapper<NewsMovieEntity> newsMovieEntityQueryWrapper = new QueryWrapper<>();
newsMovieEntityQueryWrapper.eq("id", newsMovieEntityVo.getId());
......
......@@ -121,7 +121,7 @@ public class NewtopicController extends AbstractController {
Date date = new Date();
SysUserEntity user = getUser();
NewtopicEntity newtopicEntity = new NewtopicEntity();
newtopicEntity.setAuditor(user.getUsername());
// newtopicEntity.setAuditor(user.getUsername());
newtopicEntity.setCheckflag(Integer.valueOf(params.getStatus()));
QueryWrapper<NewtopicEntity> newtopicEntityQueryWrapper = new QueryWrapper<>();
newtopicEntityQueryWrapper.eq("classid",newtopicEntity.getClassid());
......
......@@ -4,14 +4,19 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -137,6 +142,10 @@ public class PartnersController extends AbstractController {
}
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 信息
......@@ -145,7 +154,25 @@ public class PartnersController extends AbstractController {
// @RequiresPermissions("manage:partners:info")
public R getDetailInfo(@RequestBody Map<String, String> params){
PartnersEntity partners = partnersService.getById(params.get("id"));
if (partners == null) {
return R.error("没有可显示的内容");
}
if (params.get("token") != null && StringUtils.isNotBlank(params.get("token").toString())) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", params.get("token").toString());
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (partners.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", partners);
}
......
......@@ -11,14 +11,20 @@ import io.office.common.annotation.SysLog;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.entity.PictureEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.entity.dto.PictureParams;
import io.office.modules.manage.service.PictureService;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -41,10 +47,10 @@ public class PictureController extends AbstractController {
*/
@RequestMapping("/list")
@RequiresPermissions("manage:picture:list")
public R list(@RequestBody PictureParams params){
public R list(@RequestBody PictureParams params) {
Page<PictureEntity> page = this.pictureService.selectPictureList(params,
new Page(params.getPage(),params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
new Page(params.getPage(), params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
......@@ -54,8 +60,8 @@ public class PictureController extends AbstractController {
*/
@RequestMapping("/info/{pictureid}")
@RequiresPermissions("manage:picture:info")
public R info(@PathVariable("pictureid") Integer pictureid){
PictureEntity picture = pictureService.getById(pictureid);
public R info(@PathVariable("pictureid") Integer pictureid) {
PictureEntity picture = pictureService.getById(pictureid);
return R.ok().put("picture", picture);
}
......@@ -67,9 +73,9 @@ public class PictureController extends AbstractController {
@Transactional
@RequestMapping("/save")
@RequiresPermissions("manage:picture:save")
public R save(@RequestBody PictureEntity picture){
public R save(@RequestBody PictureEntity picture) {
try {
R r = this.pictureService.insertPicture(picture,getUser());
R r = this.pictureService.insertPicture(picture, getUser());
return r;
} catch (Exception e) {
log.error("picture save error:", e);
......@@ -84,7 +90,7 @@ public class PictureController extends AbstractController {
@Transactional
@RequestMapping("/update")
@RequiresPermissions("manage:picture:update")
public R update(@RequestBody PictureEntity picture){
public R update(@RequestBody PictureEntity picture) {
try {
R r = this.pictureService.updatePicture(picture, getUser());
return r;
......@@ -101,8 +107,18 @@ public class PictureController extends AbstractController {
@SysLog("删除图片资讯[picture]")
@RequestMapping("/delete")
@RequiresPermissions("manage:picture:delete")
public R delete(@RequestBody List<Long> ids){
public R delete(@RequestBody List<Long> ids) {
try {
if (CollectionUtils.isNotEmpty(ids)) {
for (Long id : ids) {
PictureEntity pictureServiceById = pictureService.getById(id);
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if (pictureServiceById.getPiclevel() == 0) {
return R.error("当前级别为0不能删除!");
}
}
}
R r = this.pictureService.deletePicture(ids, getUser());
return r;
} catch (Exception e) {
......@@ -120,7 +136,7 @@ public class PictureController extends AbstractController {
@RequiresPermissions("manage:picture:check")
public R verify(@RequestBody PictureEntity picture) {
try {
R r = this.pictureService.verifyPicture(picture,getUser());
R r = this.pictureService.verifyPicture(picture, getUser());
return r;
} catch (Exception e) {
log.error("delete error:", e);
......@@ -136,8 +152,8 @@ public class PictureController extends AbstractController {
QueryWrapper<PictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.select("TOP 3 *");
newsEntityQueryWrapper.eq("status",1);
newsEntityQueryWrapper.gt("PicLevel",0);
newsEntityQueryWrapper.eq("status", 1);
newsEntityQueryWrapper.gt("PicLevel", 0);
newsEntityQueryWrapper.orderByDesc("PicLevel");
newsEntityQueryWrapper.orderByDesc("showtime");
newsEntityQueryWrapper.orderByDesc("inputDate");
......@@ -158,8 +174,8 @@ public class PictureController extends AbstractController {
public R pictureList(@RequestBody NewsParams params) {
try {
Page<PictureEntity> page = this.pictureService.selectPictureNewList(params,
new Page(params.getPage(),params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
new Page(params.getPage(), params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
} catch (Exception e) {
log.error("pictureList error:", e);
......@@ -167,14 +183,39 @@ public class PictureController extends AbstractController {
}
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 信息
*/
@Login
@RequestMapping("/api/info/{pictureid}")
@RequestMapping({"/api/info/{pictureid}", "/api/info/{pictureid}/{token}"})
// @RequiresPermissions("manage:picture:info")
public R getDetail(@PathVariable("pictureid") Integer pictureid){
public R getDetail(@PathVariable("pictureid") Integer pictureid, @PathVariable(value = "token", required = false) String token) {
PictureEntity picture = pictureService.getById(pictureid);
if (picture == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (picture.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", picture);
}
......@@ -185,10 +226,10 @@ public class PictureController extends AbstractController {
public R retailPictureList(@RequestBody Map<String, String> params) {
try {
Page page = new Page(Long.parseLong(params.get("page")),Long.parseLong(params.get("size")));
Page page = new Page(Long.parseLong(params.get("page")), Long.parseLong(params.get("size")));
Page<PictureEntity> pictureEntityPage = pictureService.selectRetailPicture(page);
PageUtils pageUtils = new PageUtils(pictureEntityPage);
PageUtils pageUtils = new PageUtils(pictureEntityPage);
return R.ok().put("data", pageUtils);
} catch (Exception e) {
log.error("pictureList error:", e);
......
......@@ -2,6 +2,7 @@ package io.office.modules.manage.controller;
import java.util.List;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
......@@ -10,13 +11,17 @@ import io.office.common.utils.R;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.PictureEntity;
import io.office.modules.manage.entity.PolicyEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.entity.dto.PolicyParams;
import io.office.modules.manage.service.PolicyService;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -175,11 +180,40 @@ public class PolicyController extends AbstractController {
return R.ok().put("data", pageUtils);
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
@Login
@GetMapping("/api/info/{id}")
@GetMapping({"/api/info/{id}","/api/info/{id}/{token}"})
// @RequiresPermissions("manage:indexcarouselmanage:pictureImageList")
public R getDetail(@PathVariable("id") Integer id) {
public R getDetail(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) {
PolicyEntity policy = policyService.getById(id);
if (policy == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else{
if(StrUtil.equals("0",policy.getStatus())) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("data", policy);
}
......
......@@ -2,13 +2,19 @@ package io.office.modules.manage.controller;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import io.office.modules.manage.entity.ProductEntity;
......@@ -120,6 +126,11 @@ public class ProductController extends AbstractController {
}
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 分页查图书
* @param param:分页参数
......@@ -133,6 +144,26 @@ public class ProductController extends AbstractController {
new Page(Integer.valueOf(param.get("page")),
Integer.valueOf(param.get("size"))),param.get("id"));
PageUtils pageUtils = new PageUtils(pag);
if (pageUtils.getTotalCount() != 0) {
return R.error("没有可显示的内容");
}
if (param.get("token") != null && StringUtils.isNotBlank(param.get("token").toString())) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", param.get("token").toString());
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
ProductEntity productEntity = (ProductEntity) pageUtils.getList().get(0);
if (productEntity.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
return R.ok().put("page", pageUtils);
}
......
......@@ -2,14 +2,19 @@ package io.office.modules.manage.controller;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.RetailPictureParams;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -126,15 +131,39 @@ public class RetailpictureController extends AbstractController {
}
}
@Autowired
private TokenCountService tokenCountService;
@Value("${token.count}")
private int tokenCountConfig;
/**
* 信息
*/
@Login
@RequestMapping("/api/info/{pictureid}")
@RequestMapping({"/api/info/{pictureid}","/api/info/{pictureid}/{token}"})
// @RequiresPermissions("generator:picture:info")
public R getDetail(@PathVariable("pictureid") Integer pictureid){
public R getDetail(@PathVariable("pictureid") Integer pictureid, @PathVariable(value = "token", required = false) String token){
RetailpictureEntity picture = retailpictureService.getById(pictureid);
if (picture == null) {
return R.error("没有可显示的内容");
}
if (token != null && StringUtils.isNotBlank(token)) {
QueryWrapper<TokenCount> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
TokenCount tokenCount = tokenCountService.getOne(queryWrapper);
if (tokenCount == null) {
return R.error("非法请求,请获取正确的预览链接!");
}
if (tokenCount.getCountFlag() > tokenCountConfig) {
//删除无用token
return R.error("预览链接次数已达上限,请联系相关人员重新获取预览链接!");
}
} else {
if (picture.getStatus() != 1) {
return R.error("没有可显示的内容");
}
}
picture.setFlag("2");
return R.ok().put("data", picture);
}
......
package io.office.modules.manage.controller;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.service.TokenCountService;
import io.office.modules.manage.utils.DateUtils;
import io.office.modules.manage.utils.IdKeysConstant;
import io.office.modules.manage.utils.IdWorkerUtils;
import io.office.modules.sys.controller.AbstractController;
import io.office.modules.sys.entity.SysUserEntity;
import io.office.modules.sys.oauth2.TokenGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author wudi
* @date 2023/5/20
* @comment
*/
@RestController
@RequestMapping("/token")
public class TokenController extends AbstractController {
@Autowired
TokenCountService tokenCountService;
@RequestMapping("/getToken")
// @RequiresPermissions("manage:searchgtinlog:list")
public R getToken() {
SysUserEntity user = getUser();
String token = TokenGenerator.generateValue();
TokenCount tokenCount = new TokenCount();
tokenCount.setToken(token);
tokenCount.setCreateUser(user.getUsername());
tokenCount.setCreateTime(DateUtils.getCurrentTime(DateUtils.FORMAT1));
tokenCount.setId(Long.parseLong(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY)));
tokenCount.setCountFlag(0);
return R.ok().put("data", token);
}
}
package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.AnnounceEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.NewsParams;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
@Mapper
public interface TokenCountDao extends BaseMapper<TokenCount> {
}
......@@ -96,4 +96,7 @@ public class MedicalEntity implements Serializable {
@TableField("oldtitle")
private String titleOld;
@TableField(exist = false)
private String token;
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @author wudi
* @date 2023/5/20
* @comment
*/
@Data
@TableName("token_count")
public class TokenCount implements Serializable {
private static final long serialVersionUID = 1L;
private long id;
private String token;
private String createUser;
private String createTime;
private int countFlag;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.manage.entity.AnnounceEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.entity.SysUserEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
public interface TokenCountService extends IService<TokenCount> {
}
......@@ -56,9 +56,9 @@ public class AnnounceServiceImpl extends ServiceImpl<AnnounceDao, AnnounceEntity
@Override
public R verify(AnnounceEntity announce, SysUserEntity user) {
announce.setUpdatedate(new Date());
announce.setEditor(user.getUsername());
announce.setAuditor(user.getUsername());
//announce.setUpdatedate(new Date());
//announce.setEditor(user.getUsername());
//announce.setAuditor(user.getUsername());
QueryWrapper<AnnounceEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("id",announce.getId());
announceDao.update(announce, newsEntityQueryWrapper);
......
......@@ -88,7 +88,7 @@ public class CasesServiceImpl extends ServiceImpl<CasesDao, CasesEntity> impleme
public R verify(CasesEntity casesEntity, SysUserEntity user) {
QueryWrapper<CasesEntity> partnersEntityQueryWrapper = new QueryWrapper<>();
partnersEntityQueryWrapper.in("id",casesEntity.getId());
casesEntity.setAuditor(user.getUsername());
//casesEntity.setAuditor(user.getUsername());
casesEntity.setCheckdate(new Date());
int update = this.baseMapper.update(casesEntity, partnersEntityQueryWrapper);
if(update>0){
......
......@@ -55,7 +55,7 @@ public class DocServiceImpl extends ServiceImpl<DocDao, DocEntity> implements Do
public void verifyDoc(DocEntity doc,SysUserEntity user) {
QueryWrapper<DocEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id",doc.getId());
doc.setAuditor(user.getUsername());
// doc.setAuditor(user.getUsername());
this.baseMapper.update(doc,queryWrapper);
}
......
......@@ -5,6 +5,7 @@ import io.netty.util.internal.StringUtil;
import io.office.modules.manage.dao.MedicalDao;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -27,18 +28,18 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
@Override
public PageUtils queryPage(Map<String, Object> params) {
QueryWrapper<MedicalEntity> medicalEntityQueryWrapper = new QueryWrapper<>();
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("title")))){
if(params.get("title")!=null && StringUtils.isNotBlank(String.valueOf(params.get("title")))){
medicalEntityQueryWrapper.like("title",params.get("title"));
}
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("type")))){
if(params.get("type")!=null && StringUtils.isNotBlank(String.valueOf(params.get("type")))){
medicalEntityQueryWrapper.eq("type",params.get("type"));
}
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("level")))){
if(params.get("level")!=null && StringUtils.isNotBlank(String.valueOf(params.get("level")))){
medicalEntityQueryWrapper.eq("level",params.get("level"));
} else {
medicalEntityQueryWrapper.gt("level",0);
}
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("sidx")))){
if(params.get("sidx")!=null && StringUtils.isNotBlank(String.valueOf(params.get("sidx")))){
if(String.valueOf(params.get("sidx")).equalsIgnoreCase("type")) {
params.put("sidx","typeid");
}
......
......@@ -73,7 +73,7 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
}
QueryWrapper<NewsEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("id", news.getId());
news.setEditor(user.getUsername());
//news.setEditor(user.getUsername());
news.setLasteditor(user.getUsername());
if (news.getCclassid() != null) {
news.setClassid(news.getCclassid());
......@@ -102,9 +102,9 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
@Override
public R verifyNews(NewsEntity news, SysUserEntity user) {
news.setAuditor(user.getUsername());
//news.setAuditor(user.getUsername());
news.setCheckdate(new Date());
news.setLasteditor(user.getUsername());
//news.setLasteditor(user.getUsername());
QueryWrapper<NewsEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("id", news.getId());
int verify = baseMapper.update(news, newsEntityQueryWrapper);
......
......@@ -70,7 +70,7 @@ public class NewtopicServiceImpl extends ServiceImpl<NewtopicDao, NewtopicEntity
queryWrapper.like("title",params.get("title"));
}
}
queryWrapper.select("classid,title,levels,categoryID,showtime,Time,Lastupdate,editor,lasteditor,auditor,checkflag");
queryWrapper.select("classid,title,levels,categoryID,showtime,Time,Lastupdate,editor,lasteditor,auditor,checkflag,directpath");
IPage<NewtopicEntity> page = baseMapper.selectPage(new Query<NewtopicEntity>().getPage(params), queryWrapper);
List<NewtopicEntity> records = page.getRecords();
records.stream().forEach(item->{
......
......@@ -67,7 +67,7 @@ public class PartnersServiceImpl extends ServiceImpl<PartnersDao, PartnersEntity
public R verifyPartners(PartnersEntity partnersEntity, SysUserEntity user) {
QueryWrapper<PartnersEntity> partnersEntityQueryWrapper = new QueryWrapper<>();
partnersEntityQueryWrapper.in("id",partnersEntity.getId());
partnersEntity.setAuditor(user.getUsername());
// partnersEntity.setAuditor(user.getUsername());
partnersEntity.setCheckdate(new Date());
int update = this.baseMapper.update(partnersEntity, partnersEntityQueryWrapper);
if(update>0){
......
......@@ -61,7 +61,7 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
}
QueryWrapper<PictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("pictureid",picture.getPictureid());
picture.setEditor(user.getUsername());
// picture.setEditor(user.getUsername());
picture.setLasteditor(user.getUsername());
int update = baseMapper.update(picture, newsEntityQueryWrapper);
if (update>0){
......@@ -73,10 +73,12 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
@Override
public R deletePicture(List ids, SysUserEntity user) {
PictureEntity pictureEntity = new PictureEntity();
pictureEntity.setPiclevel(0);
pictureEntity.setLasteditor(user.getUsername());
pictureEntity.setEditor(user.getUsername());
//pictureEntity.setEditor(user.getUsername());
QueryWrapper<PictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.in("pictureid",ids);
int delete = baseMapper.update(pictureEntity, newsEntityQueryWrapper);
......@@ -89,9 +91,9 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
@Override
public R verifyPicture(PictureEntity picture, SysUserEntity user) {
picture.setAuditor(user.getUsername());
// picture.setAuditor(user.getUsername());
picture.setInputdate(new Date());
picture.setLasteditor(user.getUsername());
// picture.setLasteditor(user.getUsername());
QueryWrapper<PictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("pictureid",picture.getPictureid());
int verify = baseMapper.update(picture, newsEntityQueryWrapper);
......
......@@ -91,8 +91,8 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
@Override
public R verifyTopic(PolicyEntity policyEntity, SysUserEntity user) {
policyEntity.setAuditor(user.getUsername());
policyEntity.setLasteditor(user.getUsername());
// policyEntity.setAuditor(user.getUsername());
// policyEntity.setLasteditor(user.getUsername());
QueryWrapper<PolicyEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("id",policyEntity.getId());
baseMapper.update(policyEntity, newsEntityQueryWrapper);
......
......@@ -62,7 +62,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> i
@Override
public R verifyProduct(ProductEntity product, SysUserEntity user) {
product.setAuditor(user.getUsername());
// product.setAuditor(user.getUsername());
QueryWrapper<ProductEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.in("id",product.getId());
int delete = baseMapper.update(product, newsEntityQueryWrapper);
......
......@@ -87,9 +87,9 @@ public class RetailpictureServiceImpl extends ServiceImpl<RetailpictureDao, Reta
@Override
public R verifyPicture(RetailpictureEntity picture, SysUserEntity user) {
picture.setAuditor(user.getUsername());
picture.setInputdate(new Date());
picture.setLasteditor(user.getUsername());
// picture.setAuditor(user.getUsername());
// picture.setInputdate(new Date());
// picture.setLasteditor(user.getUsername());
QueryWrapper<RetailpictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("pictureid",picture.getPictureid());
int verify = baseMapper.update(picture, newsEntityQueryWrapper);
......
package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.modules.manage.dao.TimescodeRegiDao;
import io.office.modules.manage.dao.TokenCountDao;
import io.office.modules.manage.entity.TimescodeRegiEntity;
import io.office.modules.manage.entity.TokenCount;
import io.office.modules.manage.service.TokenCountService;
import org.springframework.stereotype.Service;
/**
* @author wudi
* @date 2023/5/20
* @comment
*/
@Service
public class TokenCountServiceImpl extends ServiceImpl<TokenCountDao, TokenCount> implements TokenCountService {
}
......@@ -91,9 +91,9 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
@Override
public R verifyTopic(NewsEntity news, SysUserEntity user) {
news.setAuditor(user.getUsername());
// news.setAuditor(user.getUsername());
news.setCheckdate(new Date());
news.setLasteditor(user.getUsername());
// news.setLasteditor(user.getUsername());
QueryWrapper<NewsEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("id",news.getId());
newsDao.update(news, newsEntityQueryWrapper);
......
......@@ -29,7 +29,6 @@ public class SysUserTokenServiceImpl extends ServiceImpl<SysUserTokenDao, SysUse
public R createToken(long userId) {
//生成一个token
String token = TokenGenerator.generateValue();
//当前时间
Date now = new Date();
//过期时间
......
......@@ -71,6 +71,6 @@ logging:
mybatis: debug
dao: debug
token.count: 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.office.modules.manage.dao.TokenCountDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.TokenCount" id="tokenMap">
<result property="id" column="id"/>
<result property="token" column="token"/>
<result property="createUser" column="create_user"/>
<result property="createTime" column="create_time"/>
<result property="countFlag" column="count_flag"/>
</resultMap>
</mapper>
\ No newline at end of file
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