Merge remote-tracking branch 'origin/master'

master
星期八 5 years ago
commit 3a6078727a
  1. 25
      src/main/java/com/lq/cms/service/SysRoleService.java
  2. 1
      src/main/java/com/lq/code/annotation/Length.java
  3. 31
      src/main/java/com/lq/code/entity/AjaxResult.java
  4. 2
      src/main/java/com/lq/jms/service/impl/ProductServiceImpl.java
  5. 28
      src/main/java/com/lq/wechat/web/WechatController.java

@ -12,14 +12,37 @@ import java.util.List;
* 角色事务类
*/
public interface SysRoleService extends BaseService<SysRole> {
/**
* 参数统计
* @param vo
* @return
*/
Integer count(SysRoleVo vo);
/**
* 参数分页查询
* @param vo
* @return
*/
List<SysRoleVo> findListPage(SysRoleVo vo);
/**
*
* @param userId
* @return
*/
List<SysUserRoleVo> findAllRoleVo(Long userId);
/**
* 通过用户ID查询角色
* @param userId
* @return
*/
List<SysRole> findByUserId(Long userId);
/**
* 通过角色ID删除角色
* @param roleId
*/
void deleteRole(Long roleId);
}

@ -4,6 +4,7 @@ import java.lang.annotation.*;
/**
* Created by qi_liang on 2018/4/26.
* @author qi
*/
@Documented
@Target(ElementType.FIELD)

@ -2,13 +2,20 @@ package com.lq.code.entity;
/**
* Created by qi on 2018-1-9.
* @author qi
*/
public class AjaxResult {
//操作结果
private Boolean success;
//提示信息
/**
* 操作结果
*/
private boolean success;
/**
* 提示信息
*/
private String msg;
//返回数据
/**
* 返回数据
*/
private Object data;
public AjaxResult() {
@ -46,4 +53,20 @@ public class AjaxResult {
public void setData(Object data) {
this.data = data;
}
public static AjaxResult getInstance(){
return new AjaxResult();
}
public static AjaxResult getSuccessInstance(){
return new AjaxResult();
}
public static AjaxResult getSuccessInstance(Object data){
AjaxResult ajaxResult = new AjaxResult();
ajaxResult.setData(data);
return ajaxResult;
}
}

@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
@Service
public class ProductServiceImpl implements ProductService {
@Autowired
@Autowired(required = false)
private JmsTemplate jmsTemplate;

@ -9,8 +9,6 @@ import com.lq.code.web.BaseController;
import com.lq.entity.WechatInfo;
import com.lq.entity.WechatUser;
import com.lq.wechat.mode.message.BaseMessage;
import com.lq.wechat.mode.message.ItemMessage;
import com.lq.wechat.mode.message.NewsMessage;
import com.lq.wechat.mode.message.TextMessage;
import com.lq.wechat.util.CheckUtil;
import com.lq.wechat.util.ConstantSet;
@ -26,8 +24,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
@ -92,6 +88,7 @@ public class WechatController extends BaseController {
//微信公众号详情
WechatInfo wechatInfo = wechatInfoService.getByOpenId(wechatOpenId);
if (wechatInfo!=null) {
TextMessage text = new TextMessage();
text.setFromUserName(wechatOpenId);
text.setToUserName(openId);
@ -107,28 +104,6 @@ public class WechatController extends BaseController {
baseMessage.setFromUserName(wechatOpenId);
baseMessage.setToUserName(openId);
message = MessageUtil.MessageToXml(baseMessage);
// if("1".equals(content)){
// NewsMessage newsMessage=new NewsMessage();
// List<ItemMessage> items=new ArrayList<>();
// ItemMessage item=new ItemMessage();
// item.setTitle("六弄咖啡馆");
// item.setDescription("两个人在爱在距离面前是否禁受考验?");
// String path = req.getContextPath();
// String basePath = req.getScheme()+"://"+req.getServerName()+":"+req.getServerPort()+path+"/";
// item.setPicUrl("https://img3.doubanio.com/view/photo/l/public/p2367455902.webp");
// item.setUrl("http://www.iqiyi.com/v_19rr95j3vc.html?vfm=2008_aldbd");
// items.add(item);
// newsMessage.setArticles(items);
// newsMessage.setArticleCount(1);
// newsMessage.setCreateTime(System.currentTimeMillis());
// newsMessage.setFromUserName(wechatOpenId);
// newsMessage.setMsgType(ConstantSet.MESSAGE_TYPE_NEW);
// newsMessage.setToUserName(openId);
// message = MessageUtil.MessageToXml(newsMessage);
// } else{
// text.setContent("您发送的消息是:" + content);
// message = MessageUtil.MessageToXml(text);
// }
break;
case ConstantSet.MESSAGE_TYPE_IMAGE:
@ -186,6 +161,7 @@ public class WechatController extends BaseController {
message = MessageUtil.MessageToXml(text);
break;
}
}
} catch (Exception e) {
e.printStackTrace();

Loading…
Cancel
Save