提交 d4af06d3 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 f292892c
package com.zrqx.sysuser.bg.controller.bulletin; package com.zrqx.sysuser.bg.controller.bulletin;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -16,6 +19,7 @@ import com.zrqx.core.util.page.PageInfo; ...@@ -16,6 +19,7 @@ import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam; import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack; import com.zrqx.core.util.response.CallBack;
import com.zrqx.sysuser.bg.service.bulletin.BulletinContentService; import com.zrqx.sysuser.bg.service.bulletin.BulletinContentService;
import com.zrqx.sysuser.commons.form.bg.bulletin.BulletinContentForm;
import com.zrqx.sysuser.commons.form.bg.bulletin.BulletinContentStatusForm; import com.zrqx.sysuser.commons.form.bg.bulletin.BulletinContentStatusForm;
import com.zrqx.sysuser.commons.form.bg.bulletin.QueryBulletinContentForm; import com.zrqx.sysuser.commons.form.bg.bulletin.QueryBulletinContentForm;
import com.zrqx.sysuser.commons.form.bg.bulletin.UpdateBulletinContentForm; import com.zrqx.sysuser.commons.form.bg.bulletin.UpdateBulletinContentForm;
...@@ -38,10 +42,20 @@ public class BulletinContentController { ...@@ -38,10 +42,20 @@ public class BulletinContentController {
@ApiOperation(value = "新增", notes = "新增一个") @ApiOperation(value = "新增", notes = "新增一个")
@PostMapping(value = "/save") @PostMapping(value = "/save")
public CallBack<Boolean> saveAdsign(@RequestBody BulletinContent entity) { public CallBack<Boolean> saveAdsign(@RequestBody BulletinContentForm form) {
BulletinContent entity = new BulletinContent();
Date releaserTime = null;
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
try {
releaserTime = sdf2.parse(form.getReleaserTime());
} catch (ParseException e) {
e.printStackTrace();
}
entity.setReleaserTime(releaserTime);
entity.setTopStatus(0); entity.setTopStatus(0);
entity.setCreateTime(new Date()); entity.setCreateTime(new Date());
entity.setBrowseNum(0); entity.setBrowseNum(0);
BeanUtils.copyProperties(form, entity);
if (!service.insert(entity)) { if (!service.insert(entity)) {
throw new BaseException("操作失败"); throw new BaseException("操作失败");
} }
......
package com.zrqx.sysuser.commons.form.bg.bulletin;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zrqx.core.enums.StatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 公告内容
*
*/
@Data
@ApiModel(value="BulletinContentForm",description="公告内容BulletinContentForm")
public class BulletinContentForm {
// 广告位ID
@Id
@GeneratedValue(generator="JDBC")
@ApiModelProperty(value="内容ID")
private Integer id;
@ApiModelProperty(value="内容标题",required=true)
private String title;
@ApiModelProperty(value="栏目id",required=true)
private Integer columnId;
@ApiModelProperty(value="来源",required=true)
private String source;
@ApiModelProperty(value="发布时间",required=true)
private String releaserTime;
@ApiModelProperty(value="发布人",required=true)
private String releaser;
@ApiModelProperty(value="公告内容")
private String content;
@ApiModelProperty(value="置顶状态:0未置顶,1已置顶")
private Integer topStatus;
@ApiModelProperty(value="浏览量")
private Integer browseNum;
/***
* @see StatusEnum
*/
@ApiModelProperty(value="上架状态 0:下架 1:上架")
private Integer status;
@ApiModelProperty(value="创建时间")
@JsonIgnore
private Date createTime;
@ApiModelProperty(value="更新时间")
@JsonIgnore
private Date updateTime;
/** @see com.zrqx.core.enums.LinkTypeEnum */
@ApiModelProperty(value = "链接类型 0 默认 1内链 2外链")
private String linkType;
@ApiModelProperty(value = "链接地址")
private String linkUrl;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论