Skip to content

Commit

Permalink
back 内容填充
Browse files Browse the repository at this point in the history
Controller 与 Service 层方法框架
  • Loading branch information
SmacUL committed Apr 18, 2020
1 parent 636418b commit 3d179be
Show file tree
Hide file tree
Showing 20 changed files with 881 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package com.smacul.demo.controller;

import com.smacul.demo.bean.Comment;
import com.smacul.demo.bean.Reply;
import com.smacul.demo.model.ComFullMod;
import com.smacul.demo.service.DiscussService;
import com.smacul.demo.service.ShapeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("/discuss")
Expand All @@ -19,4 +24,19 @@ public class DiscussController {
@Autowired
HttpSession session;

@RequestMapping("/page")
public List<ComFullMod> getComList(Integer artId) {
return null;
}

@RequestMapping("/com")
public String addNewCom(@RequestBody Comment comment) {
return null;
}

@RequestMapping("/rep")
public String addNewRep(@RequestBody Reply reply) {
return null;
}

}
63 changes: 63 additions & 0 deletions back/src/main/java/com/smacul/demo/controller/LoadController.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.smacul.demo.controller;

import com.smacul.demo.model.ArtFullMod;
import com.smacul.demo.service.LoadService;
import com.smacul.demo.service.ShapeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("/load")
Expand All @@ -18,4 +20,65 @@ public class LoadController {
ShapeService shapeService;
@Autowired
HttpSession session;

/**
* 获取新闻类别(英文)
*
* @return
*/
@RequestMapping("/type")
public List<String> getArtTypes() {
return null;
}

/**
* 按照类别获取一页文章,
*
* todo 包含推荐逻辑
*
* @param artType
* @param page
* @param pageSize
* @return
*/
@RequestMapping("/tiny")
public List<ArtFullMod> getTinyArtOnePageByType(String artType, Integer page, Integer pageSize) {
return null;
}

/**
* 提供一页的热点新闻
*
* @param page
* @param pageSize
* @return
*/
@RequestMapping("/hot")
public List<ArtFullMod> getHotArtOnePage(Integer page, Integer pageSize) {
return null;
}

/**
* 获取文章的主体内容, 包括文章内容与文章作者, 文章的特征以及当前用户与文章的关系.
*
* @param artId
* @return
*/
@RequestMapping("/main")
public ArtFullMod getFullArt(Integer artId) {
return null;
}

/**
* 文章点赞/点踩控制, 包括取消
*
* @param artId
* @param type 1: 点赞, 2: 点踩, -1: 取消点赞, -2: 取消点踩
* @return
*/
@RequestMapping("/prefer")
public String setArtPreference(Integer artId, Integer type) {
return null;
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.smacul.demo.controller;

import com.smacul.demo.model.ArtFullMod;
import com.smacul.demo.service.SearchService;
import com.smacul.demo.service.ShapeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("/search")
Expand All @@ -18,4 +20,9 @@ public class SearchController {
ShapeService shapeService;
@Autowired
HttpSession session;

@RequestMapping("/simple")
public List<ArtFullMod> searchContentSimple(String key, Integer page, Integer pageSize) {
return null;
}
}
42 changes: 42 additions & 0 deletions back/src/main/java/com/smacul/demo/controller/SelfController.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.smacul.demo.controller;

import com.smacul.demo.bean.Customer;
import com.smacul.demo.model.CusDynamicMod;
import com.smacul.demo.model.CusFeatureFullMod;
import com.smacul.demo.service.SearchService;
import com.smacul.demo.service.SelfService;
import com.smacul.demo.service.ShapeService;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("/self")
Expand All @@ -19,4 +25,40 @@ public class SelfController {
ShapeService shapeService;
@Autowired
HttpSession session;

@RequestMapping("/login")
public String cusLogin(String cusName, String cusPass) {
return null;
}

@RequestMapping("/register")
public String cusRegister(String cusName, String cusPass) {
return null;
}

@RequestMapping("/basic")
public Customer getCusBasicInfo(Integer cusId) {
return null;
}

@RequestMapping("/modify")
public String setCusBasicInfo(@RequestBody Customer customer) {
return null;
}

@RequestMapping("/follow")
public Boolean setCusFollow(Integer cusId) {
return null;
}

@RequestMapping("/feature")
public CusFeatureFullMod getCusFeatureInfo(Integer cusId) {
return null;
}

@RequestMapping("/dynamic")
public List<CusDynamicMod> getCusDynamic(Integer cusId, Integer page, Integer pageSize) {
return null;
}

}
129 changes: 129 additions & 0 deletions back/src/main/java/com/smacul/demo/model/ArtFullMod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package com.smacul.demo.model;

import com.smacul.demo.bean.ArtFeatureCount;
import com.smacul.demo.bean.Customer;

import java.sql.Timestamp;

public class ArtFullMod {
private Integer artId;
private String artTitle;
private String artContent;
private String artSpider;

private String artType;
private String artTags;
private String artImageUrl;
private Timestamp artTime;

private Integer artLegal;
private Integer artCusId;

private Customer customer;
private ArtFeatureCount artFeature;
private CusArtBehaviorMod cusArtBehavior;

public Integer getArtId() {
return artId;
}

public void setArtId(Integer artId) {
this.artId = artId;
}

public String getArtTitle() {
return artTitle;
}

public void setArtTitle(String artTitle) {
this.artTitle = artTitle;
}

public String getArtContent() {
return artContent;
}

public void setArtContent(String artContent) {
this.artContent = artContent;
}

public String getArtSpider() {
return artSpider;
}

public void setArtSpider(String artSpider) {
this.artSpider = artSpider;
}

public String getArtType() {
return artType;
}

public void setArtType(String artType) {
this.artType = artType;
}

public String getArtTags() {
return artTags;
}

public void setArtTags(String artTags) {
this.artTags = artTags;
}

public String getArtImageUrl() {
return artImageUrl;
}

public void setArtImageUrl(String artImageUrl) {
this.artImageUrl = artImageUrl;
}

public Timestamp getArtTime() {
return artTime;
}

public void setArtTime(Timestamp artTime) {
this.artTime = artTime;
}

public Integer getArtLegal() {
return artLegal;
}

public void setArtLegal(Integer artLegal) {
this.artLegal = artLegal;
}

public Integer getArtCusId() {
return artCusId;
}

public void setArtCusId(Integer artCusId) {
this.artCusId = artCusId;
}

public Customer getCustomer() {
return customer;
}

public void setCustomer(Customer customer) {
this.customer = customer;
}

public ArtFeatureCount getArtFeature() {
return artFeature;
}

public void setArtFeature(ArtFeatureCount artFeature) {
this.artFeature = artFeature;
}

public CusArtBehaviorMod getCusArtBehavior() {
return cusArtBehavior;
}

public void setCusArtBehavior(CusArtBehaviorMod cusArtBehavior) {
this.cusArtBehavior = cusArtBehavior;
}
}
Loading

0 comments on commit 3d179be

Please sign in to comment.