Commit 78e9723e by 18356073052

聊天工具侧边栏素材信息

1 parent 82c884b7
package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.dto.WeChatItemDto;
import com.linkwechat.wecom.service.IWeChatItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 聊天工具侧边栏
* @author kewen
*/
@RequestMapping(value = "/wecom/chat/item")
@RestController
public class WeChatItemController extends BaseController {
@Autowired
private IWeChatItemService weChatItemService;
/**
* 侧边栏抓取素材
*/
@PreAuthorize("@ss.hasPermi('chat:item:add')")
@Log(title = "侧边栏抓取素材", businessType = BusinessType.INSERT)
@PutMapping
public AjaxResult add(@RequestBody WeChatItemDto chatItemDto) {
return toAjax(weChatItemService.checkItems(chatItemDto));
}
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 聊天工具侧边栏
* @author kewen
*/
@Data
public class WeChatItem extends BaseEntity {
/**
* id
*/
private Long itemId;
/**
* 侧边栏id
*/
private Long sideId;
/**
* 素材id
*/
private Long materialId;
}
package com.linkwechat.wecom.domain.dto;
import lombok.Data;
import java.util.List;
/**
* 侧边栏素材
*
* @author kewen
*/
@Data
public class WeChatItemDto {
/**
* 素材id列表
*/
private List<Long> materialIds;
/**
* 侧边栏id
*/
private Long sideId;
/**
* 素材类型 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
*/
private String mediaType;
/**
* 是否全选 0 全选 1 非全选
*/
private String checkAll;
}
package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeChatItem;
import com.linkwechat.wecom.domain.dto.WeChatItemDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 聊天工具侧边栏
* @author kewen
*/
public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/**
* 批量添加侧边栏素材
* @param items 侧边栏素材列表
* @return 结果
*/
public int addItem(@Param("items") List<WeChatItem> items);
/**
* 删除侧边栏素材
* @param sideId 侧边栏id
* @return 结果
*/
public int dropItem(@Param("sideId") Long sideId);
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeChatItem;
import com.linkwechat.wecom.domain.dto.WeChatItemDto;
/**
* 聊天工具侧边栏
* @author kewen
*/
public interface IWeChatItemService extends IService<WeChatItem> {
/**
* 侧边栏抓取素材
*
* @param chatItemDto 侧边栏素材
* @return 结果
*/
public int checkItems(WeChatItemDto chatItemDto);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!