下载excel
parent
93636f8a7a
commit
f6a22b78f5
@ -0,0 +1,11 @@
|
||||
package com.kiisoo.ic.tag.constant;
|
||||
|
||||
/**
|
||||
* @Description: 标签静态类
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/14 0002 21:14
|
||||
* @Version: v1
|
||||
*/
|
||||
public class Constants {
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.kiisoo.ic.tag.controller;
|
||||
|
||||
import com.kiisoo.ic.common.BaseController;
|
||||
import com.kiisoo.ic.tag.entity.TagDO;
|
||||
import com.kiisoo.ic.tag.service.TagService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 标签controller
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/14 0002 21:14
|
||||
* @Version: v1
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tag")
|
||||
@Slf4j
|
||||
public class TagController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TagService tagService;
|
||||
|
||||
/**
|
||||
* 增加标签
|
||||
* @param tagDO 标签实体类
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "add",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> addTag(@RequestBody TagDO tagDO){
|
||||
try {
|
||||
Boolean hasAdd = tagService.addTag(tagDO);
|
||||
return data(hasAdd);
|
||||
}catch (Exception e){
|
||||
log.error("添加标签失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标签
|
||||
* @param tagDO 标签实体类
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "update",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> updateTag(@RequestBody TagDO tagDO){
|
||||
try {
|
||||
Boolean hasUpdate = tagService.updateTag(tagDO);
|
||||
return data(hasUpdate);
|
||||
}catch (Exception e){
|
||||
log.error("修改标签失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签
|
||||
* @param tagId 标签实体id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "delete",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String,Object> deleteTag(@RequestParam("tagId") Long tagId){
|
||||
try {
|
||||
Boolean hasDel = tagService.deleteTag(tagId);
|
||||
return data(hasDel);
|
||||
}catch (Exception e){
|
||||
log.error("删除标签失败",e);
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
|
||||
// @RequestMapping(value = "sync",method = RequestMethod.GET)
|
||||
// @ResponseBody
|
||||
// public Map<String,Object> syncTag(){
|
||||
// try {
|
||||
// Boolean hasSync = tagService.syncTag();
|
||||
// return data(hasSync);
|
||||
// }catch (Exception e){
|
||||
// log.error("添加标签失败",e);
|
||||
// return fail();
|
||||
// }
|
||||
// }
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.kiisoo.ic.tag.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 标签对象
|
||||
* @Auther: yechenhao
|
||||
* @Date: 2020/4/7 0002 10:06
|
||||
* @Version: v1
|
||||
*/
|
||||
@Data
|
||||
@TableName("privilage_tag")
|
||||
public class TagDO {
|
||||
/**
|
||||
* 数据库实体id和企业微信标签id相同
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 标签名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.kiisoo.ic.tag.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.kiisoo.ic.tag.entity.TagDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface TagDOMapper extends BaseMapper<TagDO> {
|
||||
/**
|
||||
* 查询部门最大id
|
||||
* @return
|
||||
*/
|
||||
Long selectMaxTagId();
|
||||
}
|
Loading…
Reference in New Issue