-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yang
authored and
Yang
committed
Feb 4, 2020
1 parent
8030e53
commit f507baa
Showing
52 changed files
with
1,026 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/main/java/com/jryyy/forum/config/AlipayConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.jryyy.forum.config; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.io.FileWriter; | ||
import java.io.IOException; | ||
|
||
/** | ||
* @author OU | ||
*/ | ||
|
||
@Data | ||
@Component | ||
@ConfigurationProperties(prefix = "alipay") | ||
public class AlipayConfiguration { | ||
|
||
|
||
|
||
/** | ||
* 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号 | ||
*/ | ||
private String appID; | ||
|
||
/** | ||
* 商户私钥,您的PKCS8格式RSA2私钥 | ||
*/ | ||
private String merchantPrivateKey; | ||
|
||
/** | ||
* 支付宝公钥 | ||
*/ | ||
private String alipayPublicKey; | ||
|
||
/** | ||
* 签名方式 | ||
*/ | ||
private String signType="RSA2"; | ||
|
||
/** | ||
* 网关 | ||
*/ | ||
private String gatewayUrl="https://openapi.alipay.com/gateway.do"; | ||
|
||
/** | ||
* 编码 | ||
*/ | ||
private String charset= "utf-8"; | ||
|
||
/** | ||
* 异步通知地址 | ||
*/ | ||
private String notifyUrl=""; | ||
|
||
/** | ||
* 类型 | ||
*/ | ||
private String format="json"; | ||
|
||
/** | ||
* 商户号 | ||
*/ | ||
private String sysServiceProviderId="1234"; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
package com.jryyy.forum.constant; | ||
|
||
|
||
/** | ||
* @author JrYYY | ||
* 普通(通用)常量定义 | ||
*/ | ||
public class Constants { | ||
|
||
|
||
|
||
public static final String USER_TOKEN_STRING = "Authorization"; | ||
|
||
public static final int MAXIMUM_NUMBER_ATTEMPTS = 6; | ||
|
||
public static final String DEFAULT = "0"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
src/main/java/com/jryyy/forum/controller/ZoneController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package com.jryyy.forum.controller; | ||
|
||
import com.jryyy.forum.model.Response; | ||
import com.jryyy.forum.model.request.GetZoneRequest; | ||
import com.jryyy.forum.model.request.ZoneRequest; | ||
import com.jryyy.forum.service.ZoneService; | ||
import com.jryyy.forum.utils.security.UserLoginToken; | ||
import org.springframework.web.bind.annotation.*; | ||
import javax.validation.Valid; | ||
import java.sql.ResultSet; | ||
|
||
/** | ||
* @author OU | ||
*/ | ||
@RestController | ||
@RequestMapping("/zone") | ||
public class ZoneController { | ||
|
||
private final ZoneService zoneService; | ||
|
||
public ZoneController(ZoneService zoneService) { | ||
this.zoneService = zoneService; | ||
} | ||
|
||
/** | ||
* 写入空间 | ||
* @param request {@link ZoneRequest} | ||
* @return {@link Response} | ||
* @throws Exception | ||
*/ | ||
@PostMapping("/{userId}") | ||
@UserLoginToken | ||
public Response insertZone(@PathVariable Integer userId,@ModelAttribute @Valid ZoneRequest request)throws Exception{ | ||
request.setUserId(userId); | ||
return zoneService.insertZone(request); | ||
} | ||
|
||
|
||
/** | ||
* 读取用户空间 | ||
* @param userId 用户id | ||
* @param request {@link GetZoneRequest} | ||
* @return {@link com.jryyy.forum.model.response.ZoneResponse} | ||
* @throws Exception | ||
*/ | ||
@UserLoginToken | ||
@GetMapping("/{userId}") | ||
public Response getUserZone(@PathVariable Integer userId,@ModelAttribute @Valid GetZoneRequest request)throws Exception{ | ||
return zoneService.getZone(userId,request); | ||
} | ||
|
||
/** | ||
* 删除空间 | ||
* @param userId 用户id | ||
* @param zoneId 空间id | ||
* @return {@link Response} | ||
* @throws Exception | ||
*/ | ||
@DeleteMapping("/{userId}") | ||
public Response deleteZone(@PathVariable Integer userId,@RequestParam Integer zoneId)throws Exception{ | ||
return zoneService.deleteZone(userId,zoneId); | ||
} | ||
|
||
/** | ||
* 空间评论 | ||
* @param zoneId 空间id | ||
* @return {@link Response } | ||
* @throws Exception | ||
*/ | ||
@GetMapping("/comment") | ||
public Response findZoneComment(@RequestParam Integer zoneId, @RequestParam Integer curPage, | ||
@RequestParam Integer pageSize)throws Exception{ | ||
return zoneService.findZoneComment(zoneId,curPage,pageSize); | ||
} | ||
|
||
@GetMapping("/reply") | ||
public Response findZoneComment(@RequestParam Integer id)throws Exception{ | ||
return zoneService.findReply(id); | ||
} | ||
|
||
/** | ||
* | ||
* @param userId 用户id | ||
* @param id 空间id | ||
* @param comment 消息 | ||
* @return {@link Response} | ||
* @throws Exception | ||
*/ | ||
@UserLoginToken | ||
@PostMapping("/comment/{userId}") | ||
public Response comment(@PathVariable Integer userId, @RequestParam Integer id,@RequestParam String comment,Integer pId)throws Exception{ | ||
return zoneService.comment(userId,id,comment,pId); | ||
} | ||
|
||
|
||
/** | ||
* 点赞 | ||
* @param userId 用户id | ||
* @param zoneId 空间id | ||
* @return {@link Response} | ||
* @throws Exception | ||
*/ | ||
@UserLoginToken | ||
@PutMapping("/like/{userId}") | ||
public Response like(@PathVariable Integer userId,@RequestParam Integer zoneId)throws Exception{ | ||
return zoneService.like(userId, zoneId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.