Antiloveg 8 years ago
parent
commit
c55e26a15d

+ 5 - 0
src/main/java/com/goafanti/activity/service/ActivityService.java

@@ -0,0 +1,5 @@
+package com.goafanti.activity.service;
+
+public interface ActivityService {
+
+}

+ 12 - 0
src/main/java/com/goafanti/activity/service/impl/ActivityServiceImpl.java

@@ -0,0 +1,12 @@
+package com.goafanti.activity.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.activity.service.ActivityService;
+import com.goafanti.common.dao.ActivityMapper;
+@Service
+public class ActivityServiceImpl implements ActivityService {
+	@Autowired
+	private ActivityMapper activityMapper;
+}

+ 32 - 0
src/main/java/com/goafanti/admin/controller/AdminActivityApiController.java

@@ -0,0 +1,32 @@
+package com.goafanti.admin.controller;
+
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.activity.service.ActivityService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+
+/**
+ * 活动圈
+ */
+@RestController
+@RequestMapping(value = "/api/admin/activity")
+public class AdminActivityApiController extends BaseApiController {
+	@Resource
+	private ActivityService activityService;
+
+	/**
+	 * 活动列表
+	 */
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result list(String sTime, String eTime, String name, Integer status, String host, String undertake,
+			Integer type, Integer form, String pageSize, String pageNo) {
+		Result res = new Result();
+		return res;
+
+	}
+}

+ 19 - 0
src/main/java/com/goafanti/common/dao/ActivityMapper.java

@@ -0,0 +1,19 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.Activity;
+
+public interface ActivityMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(Activity record);
+
+    int insertSelective(Activity record);
+
+    Activity selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(Activity record);
+
+    int updateByPrimaryKeyWithBLOBs(Activity record);
+
+    int updateByPrimaryKey(Activity record);
+}

+ 222 - 0
src/main/java/com/goafanti/common/mapper/ActivityMapper.xml

@@ -0,0 +1,222 @@
+<?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.goafanti.common.dao.ActivityMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.Activity" >
+    <id column="id" property="id" jdbcType="BIGINT" />
+    <result column="start_time" property="startTime" jdbcType="TIMESTAMP" />
+    <result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
+    <result column="name" property="name" jdbcType="VARCHAR" />
+    <result column="status" property="status" jdbcType="INTEGER" />
+    <result column="address" property="address" jdbcType="VARCHAR" />
+    <result column="host" property="host" jdbcType="VARCHAR" />
+    <result column="undertake" property="undertake" jdbcType="VARCHAR" />
+    <result column="asist" property="asist" jdbcType="VARCHAR" />
+    <result column="type" property="type" jdbcType="INTEGER" />
+    <result column="form" property="form" jdbcType="INTEGER" />
+    <result column="img_urls" property="imgUrls" jdbcType="VARCHAR" />
+    <result column="result" property="result" jdbcType="VARCHAR" />
+  </resultMap>
+  <resultMap id="ResultMapWithBLOBs" type="com.goafanti.common.model.Activity" extends="BaseResultMap" >
+    <result column="desc" property="desc" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, start_time, end_time, name, status, address, host, undertake, asist, type, form, 
+    img_urls, result
+  </sql>
+  <sql id="Blob_Column_List" >
+    desc
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from activity
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from activity
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.Activity" >
+    insert into activity (id, start_time, end_time, 
+      name, status, address, 
+      host, undertake, asist, 
+      type, form, img_urls, 
+      result, desc)
+    values (#{id,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, 
+      #{name,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, 
+      #{host,jdbcType=VARCHAR}, #{undertake,jdbcType=VARCHAR}, #{asist,jdbcType=VARCHAR}, 
+      #{type,jdbcType=INTEGER}, #{form,jdbcType=INTEGER}, #{imgUrls,jdbcType=VARCHAR}, 
+      #{result,jdbcType=VARCHAR}, #{desc,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.Activity" >
+    insert into activity
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="startTime != null" >
+        start_time,
+      </if>
+      <if test="endTime != null" >
+        end_time,
+      </if>
+      <if test="name != null" >
+        name,
+      </if>
+      <if test="status != null" >
+        status,
+      </if>
+      <if test="address != null" >
+        address,
+      </if>
+      <if test="host != null" >
+        host,
+      </if>
+      <if test="undertake != null" >
+        undertake,
+      </if>
+      <if test="asist != null" >
+        asist,
+      </if>
+      <if test="type != null" >
+        type,
+      </if>
+      <if test="form != null" >
+        form,
+      </if>
+      <if test="imgUrls != null" >
+        img_urls,
+      </if>
+      <if test="result != null" >
+        result,
+      </if>
+      <if test="desc != null" >
+        desc,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="startTime != null" >
+        #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null" >
+        #{endTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="name != null" >
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null" >
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="address != null" >
+        #{address,jdbcType=VARCHAR},
+      </if>
+      <if test="host != null" >
+        #{host,jdbcType=VARCHAR},
+      </if>
+      <if test="undertake != null" >
+        #{undertake,jdbcType=VARCHAR},
+      </if>
+      <if test="asist != null" >
+        #{asist,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null" >
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="form != null" >
+        #{form,jdbcType=INTEGER},
+      </if>
+      <if test="imgUrls != null" >
+        #{imgUrls,jdbcType=VARCHAR},
+      </if>
+      <if test="result != null" >
+        #{result,jdbcType=VARCHAR},
+      </if>
+      <if test="desc != null" >
+        #{desc,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Activity" >
+    update activity
+    <set >
+      <if test="startTime != null" >
+        start_time = #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null" >
+        end_time = #{endTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="name != null" >
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null" >
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="address != null" >
+        address = #{address,jdbcType=VARCHAR},
+      </if>
+      <if test="host != null" >
+        host = #{host,jdbcType=VARCHAR},
+      </if>
+      <if test="undertake != null" >
+        undertake = #{undertake,jdbcType=VARCHAR},
+      </if>
+      <if test="asist != null" >
+        asist = #{asist,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null" >
+        type = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="form != null" >
+        form = #{form,jdbcType=INTEGER},
+      </if>
+      <if test="imgUrls != null" >
+        img_urls = #{imgUrls,jdbcType=VARCHAR},
+      </if>
+      <if test="result != null" >
+        result = #{result,jdbcType=VARCHAR},
+      </if>
+      <if test="desc != null" >
+        desc = #{desc,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.Activity" >
+    update activity
+    set start_time = #{startTime,jdbcType=TIMESTAMP},
+      end_time = #{endTime,jdbcType=TIMESTAMP},
+      name = #{name,jdbcType=VARCHAR},
+      status = #{status,jdbcType=INTEGER},
+      address = #{address,jdbcType=VARCHAR},
+      host = #{host,jdbcType=VARCHAR},
+      undertake = #{undertake,jdbcType=VARCHAR},
+      asist = #{asist,jdbcType=VARCHAR},
+      type = #{type,jdbcType=INTEGER},
+      form = #{form,jdbcType=INTEGER},
+      img_urls = #{imgUrls,jdbcType=VARCHAR},
+      result = #{result,jdbcType=VARCHAR},
+      desc = #{desc,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Activity" >
+    update activity
+    set start_time = #{startTime,jdbcType=TIMESTAMP},
+      end_time = #{endTime,jdbcType=TIMESTAMP},
+      name = #{name,jdbcType=VARCHAR},
+      status = #{status,jdbcType=INTEGER},
+      address = #{address,jdbcType=VARCHAR},
+      host = #{host,jdbcType=VARCHAR},
+      undertake = #{undertake,jdbcType=VARCHAR},
+      asist = #{asist,jdbcType=VARCHAR},
+      type = #{type,jdbcType=INTEGER},
+      form = #{form,jdbcType=INTEGER},
+      img_urls = #{imgUrls,jdbcType=VARCHAR},
+      result = #{result,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 184 - 0
src/main/java/com/goafanti/common/model/Activity.java

@@ -0,0 +1,184 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class Activity {
+    private Long id;
+
+    /**
+    * 开始时间
+    */
+    private Date startTime;
+
+    /**
+    * 结束时间
+    */
+    private Date endTime;
+
+    /**
+    * 标题
+    */
+    private String name;
+
+    /**
+    * 状态
+    */
+    private Integer status;
+
+    /**
+    * 活动地址
+    */
+    private String address;
+
+    /**
+    * 主办单位
+    */
+    private String host;
+
+    /**
+    * 承办单位
+    */
+    private String undertake;
+
+    /**
+    * 协办单位,逗号隔开
+    */
+    private String asist;
+
+    /**
+    * 活动类型
+    */
+    private Integer type;
+
+    /**
+    * 活动形式
+    */
+    private Integer form;
+
+    /**
+    * 活动图片地址
+    */
+    private String imgUrls;
+
+    /**
+    * 活动结果描述
+    */
+    private String result;
+
+    /**
+    * 描述
+    */
+    private String desc;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public String getUndertake() {
+        return undertake;
+    }
+
+    public void setUndertake(String undertake) {
+        this.undertake = undertake;
+    }
+
+    public String getAsist() {
+        return asist;
+    }
+
+    public void setAsist(String asist) {
+        this.asist = asist;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getForm() {
+        return form;
+    }
+
+    public void setForm(Integer form) {
+        this.form = form;
+    }
+
+    public String getImgUrls() {
+        return imgUrls;
+    }
+
+    public void setImgUrls(String imgUrls) {
+        this.imgUrls = imgUrls;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}

+ 24 - 0
src/main/java/com/goafanti/news/bo/NewsPortalList.java

@@ -0,0 +1,24 @@
+package com.goafanti.news.bo;
+
+public class NewsPortalList extends NewsSummary {
+	private String	source;
+
+	private String	content;
+
+	public String getSource() {
+		return source;
+	}
+
+	public void setSource(String source) {
+		this.source = source;
+	}
+
+	public String getContent() {
+		return content;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+}