瀏覽代碼

add:添加banner接口

liujunchi 3 年之前
父節點
當前提交
af2d563452

+ 2 - 2
audio-analysis/src/main/java/com/yonge/netty/server/handler/NettyServerHandler.java

@@ -68,8 +68,8 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
 			HttpHeaders httpHeaders = handshakeComplete.requestHeaders();
 			String authHeader = httpHeaders.get("Authorization");
 			
-			String tokenValue = authHeader.toLowerCase().replace(OAuth2AccessToken.BEARER_TYPE.toLowerCase(), StringUtils.EMPTY).trim();
-			LOGGER.info("token:[{}]", tokenValue);
+			// String tokenValue = authHeader.toLowerCase().replace(OAuth2AccessToken.BEARER_TYPE.toLowerCase(), StringUtils.EMPTY).trim();
+			// LOGGER.info("token:[{}]", tokenValue);
 		}
 		super.userEventTriggered(ctx, evt);
 	}

+ 3 - 1
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/OmsOrderReturnApplyController.java

@@ -83,7 +83,9 @@ public class OmsOrderReturnApplyController {
             e.printStackTrace();
             log.warn("");
         } finally {
-            lock.unlock();
+            if (lock.getHoldCount() >0) {
+                lock.unlock();
+            }
         }
 
         return CommonResult.failed();

+ 3 - 1
cooleshow-mall/mall-portal/src/main/java/com/yonge/cooleshow/portal/controller/PaymentController.java

@@ -96,7 +96,9 @@ public class PaymentController extends BaseController {
             e.printStackTrace();
             return HttpResponseResult.failed("付款失败");
         } finally {
-            lock.unlock();
+            if (lock.getHoldCount()>0) {
+                lock.unlock();
+            }
         }
     }
 

+ 17 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/BannerDao.java

@@ -0,0 +1,17 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yonge.cooleshow.biz.dal.entity.SysNewsInformation;
+
+import java.util.List;
+
+/**
+ * AlbumFavoriteDao数据库访问类
+ * @author yzp
+ * @date 2022-03-25 23:46:28
+ * @version v1.0
+ **/
+public interface BannerDao extends BaseMapper<SysNewsInformation> {
+
+    List<SysNewsInformation> selectBanner();
+}

+ 311 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/SysNewsInformation.java

@@ -0,0 +1,311 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * 对应数据库表(sys_news_information):
+ */
+public class SysNewsInformation {
+
+	/**  */
+	private Long id;
+
+	/** 标题 */
+	@ApiModelProperty(value = "标题", required = true)
+	@NotBlank(message = "标题不能为空")
+	private String title;
+
+	/** 内容 */
+	@ApiModelProperty(value = "内容", required = true)
+	private String content;
+
+	/** 封面图片 */
+	@ApiModelProperty(value = "封面图片", required = false)
+	private String coverImage;
+
+	/** 视频封面图片 */
+	@ApiModelProperty(value = "视频封面图片", required = false)
+	private String videoCoverImage;
+
+	/** 类型 */
+	@ApiModelProperty(value = "类型,1热门资讯,2开屏广告,3闪页管理,4轮播图管理 5app按钮管理 6:乐理章节", required = true)
+	@NotNull(message = "类型不能为空")
+	private Integer type;
+	
+	@ApiModelProperty(value = "子类型  章节id ", required = false)
+	private Integer subType;
+
+	/** 状态(1-可见 0-不可见) */
+	@ApiModelProperty(value = "状态(1-启用 0-禁用)")
+	private Integer status;
+
+	@ApiModelProperty(value = "链接地址")
+	private String linkUrl;
+
+	@ApiModelProperty(value = "跳转类型_bank,_slef")
+	private String hrefTarget;
+
+	@ApiModelProperty(value = "顺序号", required = true)
+	private Integer order;
+	
+	@ApiModelProperty(value = "上线、生效时间", required = false)
+	private Date onlineTime;
+	
+	@ApiModelProperty(value = "下线时间", required = false)
+	private Date offlineTime;
+
+	@ApiModelProperty("展示时间")
+	private Integer showTime;
+	/**  */
+	private Date createTime;
+
+
+	@ApiModelProperty(value = "创建人id",hidden = true)
+	private Long createBy;
+
+	@ApiModelProperty(value = "修改人id",hidden = true)
+	private Long updateBy;
+
+	/**  */
+	private Date updateTime;
+
+	@ApiModelProperty(value = "备注", required = false)
+	private String memo;
+
+	private Boolean delFlag= false;
+
+	@ApiModelProperty("是否审核版本 0:否,1:是")
+	private String attribute1;
+
+	@ApiModelProperty("广告类型  IMAGE:图片,VIDEO:视频")
+	private String attribute2;
+	
+	private String subjectIdList;
+	
+	private String subjectName;
+
+	@ApiModelProperty("链接方式 IN :内部链接   OUT:外部链接")
+	private String linkType;
+
+	// 平台类型  ADMIN:平台端  STUDENT:学生端  TEACHER:老师端 WEBSITE:官网
+	@ApiModelProperty(value = "客户端类型    STUDENT:学生端  WEBSITE:官网")
+	private String clientType;
+
+	public String getClientType() {
+		return clientType;
+	}
+
+	public void setClientType(String clientType) {
+		this.clientType = clientType;
+	}
+
+	public Integer getShowTime() {
+		return showTime;
+	}
+
+	public void setShowTime(Integer showTime) {
+		this.showTime = showTime;
+	}
+
+	public Long getCreateBy() {
+		return createBy;
+	}
+
+	public void setCreateBy(Long createBy) {
+		this.createBy = createBy;
+	}
+
+	public Long getUpdateBy() {
+		return updateBy;
+	}
+
+	public void setUpdateBy(Long updateBy) {
+		this.updateBy = updateBy;
+	}
+
+	public String getLinkUrl() {
+		return linkUrl;
+	}
+
+	public void setLinkUrl(String linkUrl) {
+		this.linkUrl = linkUrl;
+	}
+
+	public String getHrefTarget() {
+		return hrefTarget;
+	}
+
+	public void setHrefTarget(String hrefTarget) {
+		this.hrefTarget = hrefTarget;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getId() {
+		return this.id;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getTitle() {
+		return this.title;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	public String getContent() {
+		return this.content;
+	}
+
+	public void setCoverImage(String coverImage) {
+		this.coverImage = coverImage;
+	}
+
+	public String getCoverImage() {
+		return this.coverImage;
+	}
+
+	public String getVideoCoverImage() {
+		return videoCoverImage;
+	}
+
+	public void setVideoCoverImage(String videoCoverImage) {
+		this.videoCoverImage = videoCoverImage;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public Integer getType() {
+		return this.type;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getCreateTime() {
+		return this.createTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public Date getUpdateTime() {
+		return this.updateTime;
+	}
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
+	public Boolean getDelFlag() {
+		return delFlag;
+	}
+
+	public void setDelFlag(Boolean delFlag) {
+		this.delFlag = delFlag;
+	}
+
+	public Integer getSubType() {
+		return subType;
+	}
+
+	public void setSubType(Integer subType) {
+		this.subType = subType;
+	}
+
+	public String getAttribute1() {
+		return attribute1;
+	}
+
+	public void setAttribute1(String attribute1) {
+		this.attribute1 = attribute1;
+	}
+
+	public String getAttribute2() {
+		return attribute2;
+	}
+
+	public void setAttribute2(String attribute2) {
+		this.attribute2 = attribute2;
+	}
+
+	public Date getOnlineTime() {
+		return onlineTime;
+	}
+
+	public void setOnlineTime(Date onlineTime) {
+		this.onlineTime = onlineTime;
+	}
+
+	public Date getOfflineTime() {
+		return offlineTime;
+	}
+
+	public void setOfflineTime(Date offlineTime) {
+		this.offlineTime = offlineTime;
+	}
+
+	public String getSubjectIdList() {
+		return subjectIdList;
+	}
+
+	public void setSubjectIdList(String subjectIdList) {
+		this.subjectIdList = subjectIdList;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+	public String getLinkType() {
+		return linkType;
+	}
+
+	public void setLinkType(String linkType) {
+		this.linkType = linkType;
+	}
+}

+ 18 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/BannerService.java

@@ -0,0 +1,18 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.entity.SysNewsInformation;
+
+import java.util.List;
+
+
+public interface BannerService extends IService<SysNewsInformation> {
+
+    /**
+     * 查询官网轮播图
+     *
+     * @return
+     */
+    List<SysNewsInformation> selectBanner();
+
+}

+ 31 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/BannerServiceImpl.java

@@ -0,0 +1,31 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.dao.BannerDao;
+import com.yonge.cooleshow.biz.dal.entity.SysNewsInformation;
+import com.yonge.cooleshow.biz.dal.service.BannerService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class BannerServiceImpl extends ServiceImpl<BannerDao, SysNewsInformation> implements BannerService {
+
+    private final static Logger log = LoggerFactory.getLogger(BannerServiceImpl.class);
+
+    @Autowired
+    private BannerDao bannerDao;
+
+    public BannerDao getDao() {
+        return bannerDao;
+    }
+
+    @Override
+    public List<SysNewsInformation> selectBanner() {
+        return baseMapper.selectBanner();
+    }
+}

+ 21 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/BannerMapper.xml

@@ -0,0 +1,21 @@
+<?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="com.yonge.cooleshow.biz.dal.dao.BannerDao">
+
+<select id="selectBanner" resultType="com.yonge.cooleshow.biz.dal.entity.SysNewsInformation">
+
+	SELECT sni.*
+	, su.username_ as updateName
+	, snt.name_ as subTypeName
+	FROM sys_news_information sni
+	left join sys_news_type snt on snt.id_ = sni.sub_type_
+	left join sys_user su on sni.update_by_ = su.id_
+		where
+		sni.del_flag_=0 and sni.type_ = 4  and if(sni.online_time_ is not null,sni.online_time_ &lt;= now(),1=1)
+	  and if(sni.offline_time_ is not null,sni.offline_time_ &gt;= now(),1=1)
+	  and sni.status_ = 1 and sni.client_type_ = 'WEBSITE'
+	order by sni.status_ desc,sni.order_,sni.update_time_ desc
+
+	</select>
+</mapper>

+ 40 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/open/OpenNewsController.java

@@ -0,0 +1,40 @@
+package com.yonge.cooleshow.website.controller.open;
+
+import com.yonge.cooleshow.biz.dal.entity.SysNewsInformation;
+import com.yonge.cooleshow.biz.dal.service.BannerService;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-06-23
+ */
+@RestController
+@RequestMapping("/open/banner")
+@Api(value = "轮播图", tags = "轮播图")
+public class OpenNewsController  extends BaseController {
+
+    @Autowired
+    private BannerService bannerService;
+
+    /**
+     * 查询分页tree
+     */
+    @GetMapping("/list")
+    @ApiOperation(value = "官网轮播图列表")
+    public HttpResponseResult<List<SysNewsInformation>> tree() {
+        List<SysNewsInformation> treeList = bannerService.selectBanner();
+        return succeed(treeList);
+    }
+
+}