first commit
This commit is contained in:
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
1
moehu/.pydio
Normal file
1
moehu/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
de8339a5-4ab5-4e79-90cc-d1c99cbefe56
|
||||
34
moehu/moehu-backend/.gitignore
vendored
Normal file
34
moehu/moehu-backend/.gitignore
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
**/node_modules/
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
config.txt
|
||||
pfx-password.txt
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
1
moehu/moehu-backend/.mvn/.pydio
Normal file
1
moehu/moehu-backend/.mvn/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
335ce5ad-b23c-48b7-85d3-8128287face8
|
||||
1
moehu/moehu-backend/.mvn/wrapper/.pydio
vendored
Normal file
1
moehu/moehu-backend/.mvn/wrapper/.pydio
vendored
Normal file
@@ -0,0 +1 @@
|
||||
781bcdfd-7704-490e-b528-ed7ddbac5556
|
||||
118
moehu/moehu-backend/.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
118
moehu/moehu-backend/.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright 2007-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6";
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if (mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if (mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if (!outputFile.getParentFile().exists()) {
|
||||
if (!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||
String username = System.getenv("MVNW_USERNAME");
|
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
moehu/moehu-backend/.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
moehu/moehu-backend/.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
2
moehu/moehu-backend/.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
moehu/moehu-backend/.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||
1
moehu/moehu-backend/.pydio
Normal file
1
moehu/moehu-backend/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
3fc80bcf-17fc-480e-a71c-024bc6e37e73
|
||||
155
moehu/moehu-backend/README.md
Normal file
155
moehu/moehu-backend/README.md
Normal file
@@ -0,0 +1,155 @@
|
||||
任务:
|
||||
|
||||
【完成】发布作品&回复评论 (需要结合发布评论时候传入等级)
|
||||
【完成】浏览量接口(调用详情接口时候自动根据IP地址来控制浏览量)
|
||||
【完成】发布作品
|
||||
【完成】查询当前作品有没有被收藏
|
||||
【完成】我的 收藏 图片列表页面
|
||||
【完成】收藏详情
|
||||
【完成】搜索接口
|
||||
【完成】收藏显示数量
|
||||
|
||||
动态:
|
||||
【完成】1:发布作品同步至动态
|
||||
【完成】2:发布动态
|
||||
【完成】3:个人空间动态 只返回用户自己的动态
|
||||
数据构成:
|
||||
用户信息(头像,昵称,用户id)
|
||||
动态信息(内容,主图,分享数,评论数,点赞数)
|
||||
|
||||
【完成】4:底部导航动态
|
||||
|
||||
【完成】5:动态评论接口
|
||||
【完成】6:获取个人空间的动态评论列表
|
||||
|
||||
7:动态的评论举报接口
|
||||
需要先修改动态表中 comment_status 为 2 (评论被举报)
|
||||
然后创建新的动态表记录 被举报的信息,至于表中字段现在不考虑,留给你再次思考
|
||||
|
||||
8:动态分享接口
|
||||
【完成】9:动态点赞接口
|
||||
|
||||
【完成】10:动态详情页
|
||||
|
||||
|
||||
|
||||
12:动态的最常访问
|
||||
【完成】所有访问别人的动态都记录
|
||||
【完成】获取当前用户的访问记录
|
||||
|
||||
|
||||
【完成】13:OpusSearch 需要修改为 三种不同的数据结构
|
||||
|
||||
【完成】14:评论列表:
|
||||
一级:评论发布人的 名字和头像
|
||||
二级:回复二级评论时有一个被艾特人的名称
|
||||
|
||||
【完成】15:动态列表接口,dynamic_imgs 无数据的时候为 [], dynamic_img 无数据的时候为 ""
|
||||
|
||||
【完成】16:获取用户个人空间的基本信息,用户名,用户头像,点赞数(别人给我作品的点赞数),粉丝数(别人关注我的数量),关注数(我关注别人的数量)
|
||||
|
||||
|
||||
|
||||
作品举报 & 动态举报 & 【接口有了】用户可以删除自己评论,可以举报他人评论
|
||||
|
||||
推荐:
|
||||
按照最新发布的作品进行排序,水平比较低的,可以再审核的那一环,选择不展示再首页的最新推荐中
|
||||
|
||||
排行:
|
||||
排行 按照 点赞量 收藏量 下载量 评论量 还自定义算法
|
||||
作品点赞数×0.1+作品浏览量×0.2+作品的关注数量×0.15+评论量×0.2=权重分数
|
||||
|
||||
【完成 但是 需要改造一下 】管理后台,昵称,头像,签名 审核功能
|
||||
|
||||
【需要讨论的问题】我的 页面存在问题,顶部图片是否需要接口返回,并且让用户可以自定义?
|
||||
|
||||
|
||||
个人空间
|
||||
|
||||
关注:我关注了哪些用户
|
||||
粉丝:谁关注了我
|
||||
|
||||
签名 + 评论底部标签被点击 出现超过布局显示提示
|
||||
收藏点击的时候使用类似手机相册的预览方式
|
||||
|
||||
详情页面:图片点击预览没有
|
||||
详情页面:没有评论的时候:显示暂无评论
|
||||
详情页面:编辑弹窗也超出了!
|
||||
详情页面:评论头像点击无法进入个人空间
|
||||
详情页面:图片加载慢的时候给个正在记载中提示...
|
||||
详情页面:已关注 文字太大换行
|
||||
|
||||
发布作品,上传图片时显示加载进度条后,可以按下物理返回键,直接返回上一页,但是进度条还在
|
||||
发布作品,发完后自动返回上一页
|
||||
|
||||
|
||||
登录过了怎么每次打开app还需要登录
|
||||
|
||||
主页点击进入搜索页面 话题显示空,历史搜索没有
|
||||
|
||||
底部tabs 动态没有调用最近访问接口
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------------------------------
|
||||
|
||||
前端App问题:
|
||||
|
||||
1:发布完作品后返回首页,首页没有重新调接口获取最新发布的数据
|
||||
【完成】2:退出登录的功能 【需要和甲方沟通待定】
|
||||
【完成】3:作品详情页 对某个人进行回复的时候,二级回复的:@xxx,这个xxx用户名显示的不对。
|
||||
例如:B对A的一级评论进行回复,预期效果应该是:"@A 哈哈哈哈",现在是:"@B 哈哈哈" 预计前端字段用错了
|
||||
|
||||
4:从作品详情页面点击分类,跳转到搜索页面后,手指滑动切换tabs,对应的tabs不请求数据,只有点击才请求
|
||||
5:作品详情页面 对某个已关注的人进行取消关注后,回到首页的 关注 tabs 中,页面数据没有刷新,需要手动刷新
|
||||
【完成】6:动态页面 发布按钮的文字 "发布" 二字换行了
|
||||
7:底部tabs 动态没有调用最近访问接口
|
||||
8:动态详情页面:热门评论 没有的时候应该给个 暂无评论
|
||||
9:个人资料编辑页面 页面功能 + 接口
|
||||
10:动态的点赞,取消点赞
|
||||
11:个人空间 的 动态 列表 ,列表显示的数据不对,存在重复,而且缺少数据。例如A B 两条数据,A数据重复显示两次,B数据不显示。
|
||||
已经排除接口问题,接口给的数据是正确的!!
|
||||
接口:https://api.moehu.net/app/dynamic/PersonalDynamic
|
||||
测试账户:
|
||||
userid:45
|
||||
登录账户:13003085288
|
||||
|
||||
12:魅族小尺寸手机上还是 个人空间 还是存在 签名溢出的情况
|
||||
|
||||
13:搜索栏当中的
|
||||
上图中“作品”和“标签”合并
|
||||
“作品”名称改为“插画”
|
||||
搜索方式,从模糊匹配改为精准匹配。
|
||||
原因:搜的“粉毛”跑出来一张白毛的插画
|
||||
|
||||
【完成】14:作品详情页用户只发布过一个作品的时候,往期作品没有展示出来
|
||||
还有就是这个下面没有展示作品
|
||||
|
||||
15:修改详情页面的布局,可点击的和不可点击(浏览量)的不放在一起
|
||||
|
||||
16:
|
||||
|
||||
还有个功能提前说一下
|
||||
|
||||
插画投稿后会进入审核状态,
|
||||
审核过程中需要有一个选项,就是给作品进行后台的分类
|
||||
尺度比较大的图片(如泳装),比如需要标记为红色
|
||||
(这里可以多准备几种颜色作为标记备用)
|
||||
|
||||
等有用户来进行举报,举报理由为尺度太大无法接受
|
||||
就把举报者的用户权限设置为不可查阅标记为红色的插画(以及其他作品)
|
||||
|
||||
补一个功能
|
||||
|
||||
刚刚提到的插画审核的页面,可以对该插画进行颜色标记
|
||||
例如:蓝色标记(蓝色标记才会进入首页的“推荐”)
|
||||
没有标记为蓝色的插画则不会进入首页中的“推荐”展示
|
||||
一个插画可以同时标记为蓝色和红色(多种颜色标记)
|
||||
|
||||
|
||||
|
||||
后端接口问题:
|
||||
1:搜索接口 作品 时候数据不对!!
|
||||
2:首页有时候进入,会显示 sql 出错的提示,接口爆500,错误已截图记录
|
||||
|
||||
【ps:从 /tag/RecommendTag 中获取数据】11:动态的话题
|
||||
来源于搜索框中的所有用户热门搜索,记录搜索关键词出现的次数,根据次数设置为热搜
|
||||
88
moehu/moehu-backend/admin.http
Normal file
88
moehu/moehu-backend/admin.http
Normal file
@@ -0,0 +1,88 @@
|
||||
### 用户登录
|
||||
POST http://127.0.0.1:8090/admin/user/Login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"admin_user_name": "test",
|
||||
"admin_user_pwd": "1"
|
||||
}
|
||||
|
||||
### 用户注册
|
||||
POST http://127.0.0.1:8090/admin/user/Reg
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"admin_user_name": "test",
|
||||
"admin_user_pwd": "1"
|
||||
}
|
||||
|
||||
### 删除某条更新
|
||||
POST http://127.0.0.1:8090/admin/tool/deleteUpdate
|
||||
#POST https://api.moehu.net/admin/tool/deleteUpdate
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNjU0NzA5MjY3LCJpYXQiOjE2MjMxNzMyNjd9.XG535nr2YtKXHipqxFZ48Zy5xP7BWPiQOId0Rfvizg8
|
||||
|
||||
{
|
||||
"update_id": 2
|
||||
}
|
||||
|
||||
### 获取作品列表
|
||||
POST http://127.0.0.1:8090/admin/opus/OpusAudit
|
||||
Content-Type: application/json
|
||||
token:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNzI3NTM3MTg3LCJpYXQiOjE2OTYwMDExODd9.DE09EcW8LmkcuoHqOGq7jWkndCAh4Q9qOrvjn7JJJT0
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 10
|
||||
}
|
||||
|
||||
### 进入作品详情
|
||||
POST http://127.0.0.1:8090/admin/opus/OpusInfo
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNzI3NTM3MTg3LCJpYXQiOjE2OTYwMDExODd9.DE09EcW8LmkcuoHqOGq7jWkndCAh4Q9qOrvjn7JJJT0
|
||||
|
||||
{
|
||||
"opus_id": 34
|
||||
}
|
||||
|
||||
|
||||
### 通过 & 拒绝 审核接口
|
||||
POST http://127.0.0.1:8090/admin/opus/Approved
|
||||
Content-Type: application/json
|
||||
token:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNjg4MDQwODAyLCJpYXQiOjE2NTY1MDQ4MDJ9.8-weA6wZBqe8gRjNveVqMFCkB48wIdoA_aKwm-r94w4
|
||||
|
||||
{
|
||||
"opus_id": 2,
|
||||
"opus_status": 0
|
||||
}
|
||||
|
||||
### 获取需要被审核的签名,昵称,头像 的数据列表
|
||||
POST http://127.0.0.1:8090/admin/user/UserVerifyList
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNjg4MDQwODAyLCJpYXQiOjE2NTY1MDQ4MDJ9.8-weA6wZBqe8gRjNveVqMFCkB48wIdoA_aKwm-r94w4
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 10,
|
||||
"type": "avatar",
|
||||
"user_id": 15
|
||||
}
|
||||
|
||||
### 对接口 UserVerifyList 进行审核
|
||||
POST http://127.0.0.1:8090/admin/user/UserReview
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNjg4MDQwODAyLCJpYXQiOjE2NTY1MDQ4MDJ9.8-weA6wZBqe8gRjNveVqMFCkB48wIdoA_aKwm-r94w4
|
||||
|
||||
{
|
||||
"user_verify_id": 13,
|
||||
"user_verify_status": 1
|
||||
}
|
||||
|
||||
### 查看 UserVerifyList 的详情
|
||||
POST http://127.0.0.1:8090/admin/user/UserItemInfo
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNjg4MDQwODAyLCJpYXQiOjE2NTY1MDQ4MDJ9.8-weA6wZBqe8gRjNveVqMFCkB48wIdoA_aKwm-r94w4
|
||||
|
||||
{
|
||||
"user_verify_id": 4
|
||||
}
|
||||
459
moehu/moehu-backend/app.http
Normal file
459
moehu/moehu-backend/app.http
Normal file
@@ -0,0 +1,459 @@
|
||||
### 用户注册
|
||||
POST http://127.0.0.1:8090/app/user/Reg
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"user_phone": "13003085265",
|
||||
"sms_code": "11111",
|
||||
"user_nickname": "测试你好"
|
||||
}
|
||||
|
||||
### 用户登录
|
||||
#POST https://api.moehu.net/app/user/Login
|
||||
POST http://127.0.0.1:8090/app/user/Login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"user_phone": "13003085265",
|
||||
"sms_code": "11111"
|
||||
}
|
||||
|
||||
|
||||
### 获取用户基本信息
|
||||
POST http://127.0.0.1:8090/app/user/UserInfo
|
||||
#POST https://api.moehu.net/app/user/UserInfo
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"user_id": 2
|
||||
}
|
||||
|
||||
### 获取最新版本
|
||||
POST http://127.0.0.1:8090/app/tool/Update
|
||||
#POST https://api.moehu.net/app/tool/Update
|
||||
Content-Type: application/json
|
||||
|
||||
{}
|
||||
|
||||
|
||||
### 获取最新版本
|
||||
POST http://127.0.0.1:8090/app/tool/addUpdateCount
|
||||
#POST https://api.moehu.net/app/tool/addUpdateCount
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"update_id": 7
|
||||
}
|
||||
|
||||
|
||||
### 更新用户信息
|
||||
POST http://127.0.0.1:8090/app/user/EditUserInfo
|
||||
#POST https://api.moehu.net/app/user/EditUserInfo
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"user_head_img": "",
|
||||
"user_nickname": "",
|
||||
"user_autograph": "不知道啥签名好!",
|
||||
"user_sex": "",
|
||||
"user_birthday": ""
|
||||
}
|
||||
|
||||
### 个人空间获取投稿作品
|
||||
POST http://127.0.0.1:8090/app/opus/OpusList
|
||||
#POST https://moehu.net/app/opus/OpusList
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 10,
|
||||
"userid": 48
|
||||
}
|
||||
|
||||
### 检查作品是否被收藏
|
||||
POST http://127.0.0.1:8090/app/opus/CheckOpusIsCollection
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"opus_id": 2
|
||||
}
|
||||
|
||||
### 作品的搜索
|
||||
POST http://127.0.0.1:8090/app/opus/OpusSearch
|
||||
#POST https://moehu.net/app/opus/OpusSearch
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"keyword": "ODg2",
|
||||
"type": "user",
|
||||
"page": 1,
|
||||
"count": 10
|
||||
}
|
||||
|
||||
### 发布和回复评论
|
||||
POST http://127.0.0.1:8090/app/comment/add
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"opus_id": 2,
|
||||
"dynamic_id": "",
|
||||
"comment_content": "测试动态的一级111",
|
||||
"comment_reply_id": 0,
|
||||
"comment_to_username": "哈哈哈",
|
||||
"comment_type": 1
|
||||
}
|
||||
|
||||
### 获取所有评论
|
||||
POST http://127.0.0.1:8090/app/comment/list
|
||||
#POST https://moehu.net/app/comment/list
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"opus_id": 2,
|
||||
"dynamic_id": "",
|
||||
"page": 1,
|
||||
"count": 10,
|
||||
"comment_type": 1
|
||||
}
|
||||
|
||||
### 删除评论
|
||||
POST http://127.0.0.1:8090/app/comment/delete
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"comment_id": 1,
|
||||
"level": 2
|
||||
}
|
||||
|
||||
|
||||
### 举报评论
|
||||
POST http://127.0.0.1:8090/app/comment/report
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"comment_id": 1
|
||||
}
|
||||
|
||||
### 作品详情
|
||||
POST http://127.0.0.1:8090/app/opus/OpusInfo
|
||||
#POST https://moehu.net/app/opus/OpusInfo
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"opus_id": 2
|
||||
}
|
||||
|
||||
|
||||
### 发布作品
|
||||
POST http://127.0.0.1:8090/app/opus/PushOpus
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNjczNDY2NjMzLCJpYXQiOjE2NDE5MzA2MzN9.Ia8QnNjHqqmVjc6eSI4H_T7LjvWzFgwW2cXacDcO41U
|
||||
|
||||
{
|
||||
"opus_title": "2222",
|
||||
"opus_introduce": "不知道写啥介绍了2",
|
||||
"opus_tags": ["游戏","2"],
|
||||
"opus_imgs": ["https://moehu.oss-cn-shanghai.aliyuncs.com/img/3cbf27abdeaf4a1889b35540c22dd1a7-image_picker8237324953817607310.jpg","https://moehu.oss-cn-shanghai.aliyuncs.com/img/ee5f823466f74adab43ed91d456d8f2f-SH5YOE4KAH%29HA%7E%7EV41NJSU1.jpg","https://moehu.oss-cn-shanghai.aliyuncs.com/img/125f8ae768af44cb8dc4cde6889e5aa8-image_picker2622047004534626946.jpg"],
|
||||
"opus_jurisdiction": 1,
|
||||
"opus_original": 1,
|
||||
"opus_time": "测试发布时间",
|
||||
"opus_syncDynamic": false
|
||||
}
|
||||
|
||||
|
||||
### 发布动态
|
||||
POST http://127.0.0.1:8090/app/dynamic/Push
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIiwiZXhwIjoxNjczNDY2NjMzLCJpYXQiOjE2NDE5MzA2MzN9.Ia8QnNjHqqmVjc6eSI4H_T7LjvWzFgwW2cXacDcO41U
|
||||
|
||||
{
|
||||
"dynamic_introduce": "测试发布动态的介绍2",
|
||||
"dynamic_imgs": ["https://moehu.oss-cn-shanghai.aliyuncs.com/img/1.jpg","https://moehu.oss-cn-shanghai.aliyuncs.com/310.jpg","https://moehu.oss-cn-shanghai.aliyuncs.com/img/1946.jpg"]
|
||||
}
|
||||
|
||||
### 个人空间获取动态
|
||||
POST http://127.0.0.1:8090/app/dynamic/PersonalDynamic
|
||||
#POST https://api.moehu.net/app/dynamic/PersonalDynamic
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 10,
|
||||
"userid": 1
|
||||
}
|
||||
|
||||
|
||||
### 底部tabs导航的动态,获取动态列表
|
||||
POST http://127.0.0.1:8090/app/dynamic/TabsDynamic
|
||||
#POST https://moehu.net/app/dynamic/TabsDynamic
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 2
|
||||
}
|
||||
|
||||
### 普通动态的详情
|
||||
#POST http://127.0.0.1:8090/app/dynamic/Info
|
||||
POST https://moehu.net/app/dynamic/Info
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"dynamic_id": 1
|
||||
}
|
||||
|
||||
### 记录动态的最常访问
|
||||
POST http://127.0.0.1:8090/app/dynamic/RecordHistory
|
||||
#POST http://120.27.144.174:8091/app/dynamic/RecordHistory
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"user_to_id": 1
|
||||
}
|
||||
|
||||
### 获取最常访问的列表
|
||||
POST http://127.0.0.1:8090/app/dynamic/DynamicHistory
|
||||
#POST http://120.27.144.174:8091/app/dynamic/DynamicHistory
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 1
|
||||
}
|
||||
|
||||
### 获取【推荐】的作品
|
||||
POST http://127.0.0.1:8090/app/opus/Recommend
|
||||
#POST https://moehu.net/app/opus/Recommend
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 100
|
||||
}
|
||||
|
||||
### 获取【排行】的作品
|
||||
POST http://127.0.0.1:8090/app/opus/Ranking
|
||||
#POST http://120.27.144.174:8091/app/opus/Ranking
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 100
|
||||
}
|
||||
|
||||
### 【需要Token】获取【关注】的作品
|
||||
POST http://127.0.0.1:8090/app/opus/Follow
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 15
|
||||
}
|
||||
|
||||
### 【需要Token】关注和取消关注接口
|
||||
POST http://127.0.0.1:8090/app/opus/FollowUser
|
||||
#POST https://moehu.net/app/opus/FollowUser
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"user_to_id": 18
|
||||
}
|
||||
|
||||
### 个人空间【关注】获取我关注的所有用户
|
||||
POST http://127.0.0.1:8090/app/user/FollowUserList
|
||||
#POST https://moehu.net/app/user/FollowUserList
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"user_id": 1,
|
||||
"page": 1,
|
||||
"count": 10
|
||||
}
|
||||
|
||||
|
||||
### 个人空间【粉丝】获取关注我的粉丝
|
||||
POST http://127.0.0.1:8090/app/user/FansUserList
|
||||
#POST https://moehu.net/app/user/FansUserList
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"user_id": 1,
|
||||
"page": 1,
|
||||
"count": 10
|
||||
}
|
||||
|
||||
|
||||
|
||||
### 【需要Token】检查当前用户是否被关注
|
||||
POST http://127.0.0.1:8090/app/opus/CheckUserIsFollow
|
||||
#POST https://moehu.net/app/opus/CheckUserIsFollow
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"user_to_id": 18
|
||||
}
|
||||
|
||||
|
||||
### 获取排行的作品
|
||||
POST http://127.0.0.1:8090/app/opus/Ranking
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 15
|
||||
}
|
||||
|
||||
### 获取推荐的作品
|
||||
POST http://127.0.0.1:8090/app/opus/Recommend
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 15
|
||||
}
|
||||
|
||||
### 获取标签下作品列表
|
||||
POST http://127.0.0.1:8090/app/tag/TagOpusList
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"tags_title": "5bCP5aSr"
|
||||
}
|
||||
|
||||
### 更新作品详情页是否允许编辑的状态
|
||||
POST http://127.0.0.1:8090/app/tag/UpdateTagsEditStatus
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"opus_id": 36,
|
||||
"edit_status": 0
|
||||
}
|
||||
|
||||
### 【需要Token】创建标签的接口
|
||||
POST http://127.0.0.1:8090/app/tag/CreatedTags
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"tag_arr": ["测试1","吃啥2","测试3"]
|
||||
}
|
||||
|
||||
|
||||
### 【需要Token】详情页面创建标签接口
|
||||
POST http://127.0.0.1:8090/app/tag/OpusInfoCreatedTags
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"tags_title": "测试标签的标题",
|
||||
"user_id": 18,
|
||||
"opus_id": 2
|
||||
}
|
||||
|
||||
### 【需要Token】获取用户创建的所有标签
|
||||
POST http://127.0.0.1:8090/app/tag/UserTagList
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
### 【需要Token】编辑标签
|
||||
POST http://127.0.0.1:8090/app/tag/EditTag
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"tags_id": 3,
|
||||
"tags_title": "小夫-修改测试4"
|
||||
}
|
||||
|
||||
### 【需要Token】删除标签
|
||||
POST http://127.0.0.1:8090/app/tag/DeleteTag
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"tags_id": 9
|
||||
}
|
||||
|
||||
### 【需要Token】收藏 & 取消收藏 作品
|
||||
POST http://127.0.0.1:8090/app/opus/CollectionOpus
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"opus_id": 3
|
||||
}
|
||||
|
||||
|
||||
### 【需要Token】获取用户收藏的作品列表
|
||||
POST http://127.0.0.1:8090/app/opus/CollectionOpusList
|
||||
#POST https://moehu.net/app/opus/CollectionOpusList
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"userid": 2
|
||||
}
|
||||
|
||||
### 获取被收藏作品的详情图片
|
||||
POST http://127.0.0.1:8090/app/opus/CollectionOpusInfo
|
||||
#POST https://moehu.net/app/opus/CollectionOpusInfo
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"opus_id": 2
|
||||
}
|
||||
|
||||
### 作品的标签
|
||||
POST http://127.0.0.1:8090/app/tag/OpusTag
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"opus_id": 2
|
||||
}
|
||||
|
||||
### 取消 & 点赞 接口
|
||||
POST http://127.0.0.1:8090/app/opus/UpvoteOpus
|
||||
#POST https://moehu.net/app/opus/UpvoteOpus
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"opus_id": 2,
|
||||
"dynamic_id": ""
|
||||
}
|
||||
|
||||
### 【需要Token】检查作品 & 动态 是否被点赞
|
||||
POST http://127.0.0.1:8090/app/opus/CheckIsUpvote
|
||||
#POST https://moehu.net/app/opus/CheckIsUpvote
|
||||
Content-Type: application/json
|
||||
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNjg4MDQxMTE3LCJpYXQiOjE2NTY1MDUxMTd9.Dy8-VYlFkfVohx0AyiNkfw9w8YwrMEN4VicleYRxQW8
|
||||
|
||||
{
|
||||
"opus_id": 2,
|
||||
"dynamic_id": ""
|
||||
}
|
||||
|
||||
### 获取推荐标签
|
||||
POST http://127.0.0.1:8090/app/tag/RecommendTag
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"count": 15
|
||||
}
|
||||
1
moehu/moehu-backend/logs/.pydio
Normal file
1
moehu/moehu-backend/logs/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
c81733e1-f5a0-4862-84a2-c40ddac6570e
|
||||
22
moehu/moehu-backend/logs/run.log
Normal file
22
moehu/moehu-backend/logs/run.log
Normal file
@@ -0,0 +1,22 @@
|
||||
2024-01-13 00:14:49.736 INFO 28310 --- [main] com.moehu.back.BackApplication : Starting BackApplication using Java 11.0.17 on bmydeMBP with PID 28310 (/Users/bmy/source/公司项目/moehu/moehu-backend/target/classes started by bmy in /Users/bmy/source/公司项目/moehu/moehu-backend)
|
||||
2024-01-13 00:14:49.749 INFO 28310 --- [main] com.moehu.back.BackApplication : The following profiles are active: dev
|
||||
2024-01-13 00:14:51.836 INFO 28310 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8090 (http)
|
||||
2024-01-13 00:14:51.849 INFO 28310 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
|
||||
2024-01-13 00:14:51.850 INFO 28310 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.44]
|
||||
2024-01-13 00:14:51.951 INFO 28310 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
|
||||
2024-01-13 00:14:51.952 INFO 28310 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2130 ms
|
||||
2024-01-13 00:14:53.074 INFO 28310 --- [main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
|
||||
2024-01-13 00:14:53.257 INFO 28310 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2024-01-13 00:14:53.704 INFO 28310 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8090 (http) with context path ''
|
||||
2024-01-13 00:14:53.706 INFO 28310 --- [main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
|
||||
2024-01-13 00:14:53.725 INFO 28310 --- [main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
|
||||
2024-01-13 00:14:53.772 INFO 28310 --- [main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
|
||||
2024-01-13 00:14:54.159 INFO 28310 --- [main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: OpusInfoUsingPOST_1
|
||||
2024-01-13 00:14:54.288 INFO 28310 --- [main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: UploadFileUsingPOST_1
|
||||
2024-01-13 00:14:54.301 INFO 28310 --- [main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: EditUserInfoUsingPOST_1
|
||||
2024-01-13 00:14:54.316 INFO 28310 --- [main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: LoginUsingPOST_1
|
||||
2024-01-13 00:14:54.350 INFO 28310 --- [main] com.moehu.back.BackApplication : Started BackApplication in 5.475 seconds (JVM running for 6.641)
|
||||
2024-01-13 00:15:14.296 INFO 28310 --- [http-nio-8090-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2024-01-13 00:15:14.299 INFO 28310 --- [http-nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
|
||||
2024-01-13 00:15:14.308 INFO 28310 --- [http-nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 9 ms
|
||||
2024-01-13 00:20:08.189 INFO 28310 --- [SpringContextShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
BIN
moehu/moehu-backend/logs/run.log.2022-01-12.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2022-01-12.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2022-06-29.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2022-06-29.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2022-06-30.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2022-06-30.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2023-09-26.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2023-09-26.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2023-09-27.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2023-09-27.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2023-09-28.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2023-09-28.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2023-09-29.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2023-09-29.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2023-09-30.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2023-09-30.0.gz
Normal file
Binary file not shown.
BIN
moehu/moehu-backend/logs/run.log.2023-10-01.0.gz
Normal file
BIN
moehu/moehu-backend/logs/run.log.2023-10-01.0.gz
Normal file
Binary file not shown.
277
moehu/moehu-backend/moehu.sql
Normal file
277
moehu/moehu-backend/moehu.sql
Normal file
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : 127.0.0.1
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80026
|
||||
Source Host : localhost:3306
|
||||
Source Schema : moehu
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80026
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 11/03/2022 21:47:39
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_collection
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_collection`;
|
||||
CREATE TABLE `moehu_collection` (
|
||||
`collection_id` int NOT NULL AUTO_INCREMENT,
|
||||
`opus_id` int DEFAULT NULL,
|
||||
`user_id` int DEFAULT NULL,
|
||||
PRIMARY KEY (`collection_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_collection
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_comment
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_comment`;
|
||||
CREATE TABLE `moehu_comment` (
|
||||
`comment_id` int NOT NULL DEFAULT '1' COMMENT '评论的id',
|
||||
`opus_id` int DEFAULT NULL COMMENT '作品表的作品id',
|
||||
`dynamic_id` int DEFAULT NULL COMMENT '动态的id',
|
||||
`user_id` int DEFAULT NULL COMMENT '用户表的用户id',
|
||||
`comment_content` longtext COMMENT '评论的内容',
|
||||
`comment_time` timestamp(6) NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '评论的时间',
|
||||
`comment_reply_id` int DEFAULT NULL COMMENT '回复某个人的comment_id',
|
||||
`comment_to_username` varchar(255) DEFAULT NULL COMMENT '被回复人的用户名',
|
||||
`user_nickname` varchar(255) DEFAULT NULL COMMENT '用户名',
|
||||
`user_head_img` varchar(255) DEFAULT NULL COMMENT '用户头像',
|
||||
`comment_type` int DEFAULT NULL COMMENT '评论的类型:1 作品,2 动态',
|
||||
PRIMARY KEY (`comment_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_comment
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_dynamic
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_dynamic`;
|
||||
CREATE TABLE `moehu_dynamic` (
|
||||
`dynamic_id` int NOT NULL AUTO_INCREMENT COMMENT '动态id',
|
||||
`opus_id` int DEFAULT NULL COMMENT '作品id',
|
||||
`user_id` int DEFAULT NULL COMMENT '用户id',
|
||||
`dynamic_introduce` longtext COMMENT '动态的内容',
|
||||
`dynamic_top` int DEFAULT '0' COMMENT '动态是否置顶,1置顶,0不置顶',
|
||||
`dynamic_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '动态的发布时间',
|
||||
`dynamic_share_count` int DEFAULT '0' COMMENT '动态分享的数量',
|
||||
`dynamic_comment_count` int DEFAULT '0' COMMENT '动态被评论的数量',
|
||||
`dynamic_satisfied_count` int DEFAULT '0' COMMENT '动态点赞的数量',
|
||||
`dynamic_text` varchar(255) DEFAULT '投稿了新作' COMMENT '投稿动态:''投稿了新作'',如果是普通动态为'''' ',
|
||||
`dynamic_type` int DEFAULT '2' COMMENT '动态的类型:1 投稿动态,2:普通动态',
|
||||
`dynamic_img` varchar(255) DEFAULT NULL COMMENT '动态的封面图',
|
||||
PRIMARY KEY (`dynamic_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_dynamic
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `moehu_dynamic` VALUES (1, NULL, 1, '测试发布动态的介绍2', 0, '2022-01-12 04:01:28', 0, 0, 0, '', 0, NULL);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_follow
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_follow`;
|
||||
CREATE TABLE `moehu_follow` (
|
||||
`user_to_id` int DEFAULT NULL COMMENT '被关注的人',
|
||||
`user_source_id` int DEFAULT NULL COMMENT '来源的人',
|
||||
`follow_id` int NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`follow_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_follow
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_img
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_img`;
|
||||
CREATE TABLE `moehu_img` (
|
||||
`img_id` int NOT NULL AUTO_INCREMENT,
|
||||
`img_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片地址',
|
||||
`img_width` double DEFAULT NULL COMMENT '图片宽度',
|
||||
`img_height` double DEFAULT NULL COMMENT '图片高度',
|
||||
`opus_id` int DEFAULT NULL COMMENT '作品id',
|
||||
`user_id` int DEFAULT NULL COMMENT '用户id',
|
||||
`dynamic_id` int DEFAULT NULL COMMENT '动态id',
|
||||
PRIMARY KEY (`img_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_img
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `moehu_img` VALUES (4, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/3cbf27abdeaf4a1889b35540c22dd1a7-image_picker8237324953817607310.jpg', 1080, 2340, 2, 1, NULL);
|
||||
INSERT INTO `moehu_img` VALUES (5, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/ee5f823466f74adab43ed91d456d8f2f-SH5YOE4KAH%29HA%7E%7EV41NJSU1.jpg', 1078, 1912, 2, 1, NULL);
|
||||
INSERT INTO `moehu_img` VALUES (6, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/125f8ae768af44cb8dc4cde6889e5aa8-image_picker2622047004534626946.jpg', 1080, 2340, 2, 1, NULL);
|
||||
INSERT INTO `moehu_img` VALUES (7, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/1.jpg', NULL, NULL, NULL, 1, 1);
|
||||
INSERT INTO `moehu_img` VALUES (8, 'https://moehu.oss-cn-shanghai.aliyuncs.com/310.jpg', NULL, NULL, NULL, 1, 1);
|
||||
INSERT INTO `moehu_img` VALUES (9, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/1946.jpg', NULL, NULL, NULL, 1, 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_opus
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_opus`;
|
||||
CREATE TABLE `moehu_opus` (
|
||||
`opus_id` int NOT NULL AUTO_INCREMENT COMMENT '作品id',
|
||||
`user_id` int DEFAULT NULL COMMENT '用户id',
|
||||
`opus_title` varchar(255) DEFAULT NULL COMMENT '作品名称',
|
||||
`opus_introduce` varchar(255) DEFAULT NULL COMMENT '作品介绍',
|
||||
`opus_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '作品发布时间',
|
||||
`opus_satisfied` int DEFAULT '0' COMMENT '作品点赞数',
|
||||
`opus_see` int DEFAULT '0' COMMENT '作品浏览量',
|
||||
`opus_follow` int DEFAULT '0' COMMENT '作品的关注数量',
|
||||
`opus_collection` int DEFAULT '0' COMMENT '作品的收藏数量',
|
||||
`opus_img` varchar(255) DEFAULT NULL COMMENT '作品的图片',
|
||||
`opus_status` int DEFAULT '0' COMMENT '作品的审核状态。等待审核0,审核驳回-1,审核通过1',
|
||||
`opus_type` int DEFAULT '1' COMMENT '作品的分类,推荐1,排行2,关注3',
|
||||
`opus_original` int DEFAULT '1' COMMENT '作品是否原创 ,1原创,0 非原创',
|
||||
`opus_jurisdiction` int DEFAULT '1' COMMENT '作品公开范围,1所有人,2好友,3不公开',
|
||||
`opus_is_edit` int DEFAULT '0' COMMENT '作品的标签是否可被编辑,1 开启编辑,0 没有开启编辑',
|
||||
`opus_satisfied_offset` float(255,0) DEFAULT '1' COMMENT '点赞数的偏移量',
|
||||
`opus_see_offset` float(255,0) DEFAULT '1' COMMENT '作品浏览量的偏移量',
|
||||
`opus_follow_offset` float(255,0) DEFAULT '1' COMMENT '作品的关注数量的偏移量',
|
||||
PRIMARY KEY (`opus_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_opus
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `moehu_opus` VALUES (2, 1, '测试作品2', '不知道写啥介绍了2', '2022-01-12 04:06:27', 1, 0, 0, 0, 'https://moehu.oss-cn-shanghai.aliyuncs.com/img/3cbf27abdeaf4a1889b35540c22dd1a7-image_picker8237324953817607310.jpg', 0, 1, 1, 1, 0, 1, 1, 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_see
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_see`;
|
||||
CREATE TABLE `moehu_see` (
|
||||
`see_id` int NOT NULL AUTO_INCREMENT,
|
||||
`see_address` varchar(255) DEFAULT NULL,
|
||||
`opus_id` int DEFAULT NULL,
|
||||
PRIMARY KEY (`see_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_see
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_tags
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_tags`;
|
||||
CREATE TABLE `moehu_tags` (
|
||||
`tags_id` int NOT NULL AUTO_INCREMENT COMMENT '标签id',
|
||||
`opus_id` int DEFAULT NULL COMMENT '作品id',
|
||||
`tags_title` varchar(255) DEFAULT NULL COMMENT '标签的内容',
|
||||
`tags_recommend` int DEFAULT '1' COMMENT '该标签是否为推荐标签',
|
||||
`user_id` int DEFAULT NULL COMMENT '创建标签的用户id',
|
||||
PRIMARY KEY (`tags_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_tags
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `moehu_tags` VALUES (3, 2, '游戏', 1, 1);
|
||||
INSERT INTO `moehu_tags` VALUES (4, 2, '美女', 1, 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_update
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_update`;
|
||||
CREATE TABLE `moehu_update` (
|
||||
`update_id` int DEFAULT NULL COMMENT '升级表id',
|
||||
`update_version` varchar(255) DEFAULT NULL COMMENT 'app版本号',
|
||||
`update_version_code` int DEFAULT NULL COMMENT '整数类型app版本号',
|
||||
`update_down_url` varchar(255) DEFAULT NULL COMMENT 'app下载地址',
|
||||
`update_content` longtext COMMENT 'app更新的内容',
|
||||
`update_force` int DEFAULT '1' COMMENT '是否需要强制更新 1 需要,0不需要',
|
||||
`update_down_count` int DEFAULT '100' COMMENT 'app下载次数统计',
|
||||
`update_size` int DEFAULT '0' COMMENT 'app安装包大小,单位b',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'app发布版本时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_update
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_upvote
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_upvote`;
|
||||
CREATE TABLE `moehu_upvote` (
|
||||
`upvote_id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int DEFAULT NULL,
|
||||
`dynamic_id` int DEFAULT NULL,
|
||||
`opus_id` int DEFAULT NULL,
|
||||
PRIMARY KEY (`upvote_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_upvote
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `moehu_upvote` VALUES (1, 1, NULL, 2);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for moehu_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `moehu_user`;
|
||||
CREATE TABLE `moehu_user` (
|
||||
`user_id` int NOT NULL AUTO_INCREMENT COMMENT '用户id',
|
||||
`user_phone` varchar(255) DEFAULT NULL COMMENT '用户的手机号',
|
||||
`user_pwd` varchar(255) DEFAULT NULL COMMENT '用户的密码',
|
||||
`user_real_name` varchar(255) DEFAULT NULL COMMENT '用户真实姓名',
|
||||
`user_id_card` varchar(255) DEFAULT NULL COMMENT '用户身份证',
|
||||
`user_email` varchar(255) DEFAULT NULL COMMENT '用户邮箱',
|
||||
`user_bank_card` varchar(255) DEFAULT NULL COMMENT '用户银行卡',
|
||||
`user_sex` varchar(255) DEFAULT NULL COMMENT '用户性别',
|
||||
`user_work` varchar(255) DEFAULT NULL COMMENT '用户的职业',
|
||||
`user_head_img` varchar(255) DEFAULT NULL COMMENT '用户头像',
|
||||
`user_nickname` varchar(255) DEFAULT NULL COMMENT '用户默认昵称',
|
||||
`user_uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用户申请账号的固定ID,不可修改',
|
||||
`user_reg_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '用户注册的时间',
|
||||
`user_ip` varchar(255) DEFAULT NULL COMMENT '用户最后一次登录ip',
|
||||
`user_birthday` varchar(255) DEFAULT NULL COMMENT '用户出生日期',
|
||||
`user_constellation` varchar(255) DEFAULT NULL COMMENT '用户的星座',
|
||||
`user_autograph` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '这个人很懒,什么都没有!' COMMENT '用户签名',
|
||||
PRIMARY KEY (`user_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of moehu_user
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `moehu_user` VALUES (1, '15155145354', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '测试账号', '9da78f56a1da4c009735608cd8250464', NULL, NULL, NULL, NULL, '这个人很懒,什么都没有!');
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
310
moehu/moehu-backend/mvnw
vendored
Executable file
310
moehu/moehu-backend/mvnw
vendored
Executable file
@@ -0,0 +1,310 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
else
|
||||
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
fi
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if $cygwin; then
|
||||
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget "$jarUrl" -O "$wrapperJarPath"
|
||||
else
|
||||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||
else
|
||||
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||
fi
|
||||
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaClass=`cygpath --path --windows "$javaClass"`
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
182
moehu/moehu-backend/mvnw.cmd
vendored
Normal file
182
moehu/moehu-backend/mvnw.cmd
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
|
||||
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
||||
178
moehu/moehu-backend/pom.xml
Normal file
178
moehu/moehu-backend/pom.xml
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.4.4</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<groupId>com.moehu</groupId>
|
||||
<artifactId>back</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>back</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.janeluo</groupId>
|
||||
<artifactId>ikanalyzer</artifactId>
|
||||
<version>2012_u6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.23</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.18</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.7.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.7.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.10.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.47</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>3.10.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.0.6</version> <!-- 注:如提示报错,先升级基础包版,无法解决可联系技术支持 -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
<version>1.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.2.13</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<version>2.4.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.4.4</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<!-- Build an executable JAR -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>com.moehu.back.BackApplication</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
||||
</project>
|
||||
1
moehu/moehu-backend/pull/.pydio
Normal file
1
moehu/moehu-backend/pull/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
f933765a-86e1-4472-9040-0a18cdf1a664
|
||||
35
moehu/moehu-backend/pull/index.js
Normal file
35
moehu/moehu-backend/pull/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const app = require('express')(),
|
||||
exec = require('child_process').execFile;
|
||||
|
||||
app.post('/pull', (req, res) => {
|
||||
exec('/root/moehu-backend/pull/pull.sh',{
|
||||
cwd: './',
|
||||
encoding: 'utf8',
|
||||
stdio: 'inherit'
|
||||
}, (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
console.log(`命令执行错误 err:${err}`)
|
||||
console.log(`命令执行错误 stdout:${stdout}`)
|
||||
console.log(`命令执行错误 stderr :${stderr}`)
|
||||
res.json({
|
||||
title: 'error',
|
||||
message: err.message
|
||||
})
|
||||
} else {
|
||||
console.log(`命令成功错误 err:${err}`)
|
||||
console.log(`命令成功错误 stdout:${stdout}`)
|
||||
console.log(`命令成功错误 stderr :${stderr}`)
|
||||
res.json({
|
||||
title: 'success1',
|
||||
})
|
||||
}
|
||||
|
||||
res.json({
|
||||
title: 'success2',
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
app.listen(1314, () => {
|
||||
console.log('Node.js自动部署运行在: 1314')
|
||||
})
|
||||
15
moehu/moehu-backend/pull/package.json
Normal file
15
moehu/moehu-backend/pull/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "pull",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev": "pm2 start index.js --name pull --watch -i max"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.17.1"
|
||||
}
|
||||
}
|
||||
20
moehu/moehu-backend/pull/pull.sh
Executable file
20
moehu/moehu-backend/pull/pull.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 项目路径
|
||||
jar_path=/root/moehu-backend
|
||||
#编译好的jar名称
|
||||
jar_name=/target/back-0.0.1-SNAPSHOT.jar
|
||||
|
||||
# 进入指定项目路径
|
||||
cd ${jar_path}
|
||||
|
||||
# 获取运行编译好的进程ID,便于我们在重新部署项目的时候先杀掉以前的进程
|
||||
pid=$(cat /root/moehu-backend/moehu.pid)
|
||||
|
||||
# 拉取代码,编译打包
|
||||
git pull && /root/maven/bin/mvn clean package -Dmaven.test.skip=true && kill -9 ${pid}
|
||||
|
||||
# nohup java -jar ${jar_path}${jar_name} --spring.profiles.active=prod &
|
||||
cd target/ && nohup java -jar back-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod &
|
||||
|
||||
echo $! > /root/moehu-backend/moehu.pid
|
||||
1
moehu/moehu-backend/src/.pydio
Normal file
1
moehu/moehu-backend/src/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
daa2ac39-b732-4549-807e-d5dda943ce0d
|
||||
1
moehu/moehu-backend/src/main/.pydio
Normal file
1
moehu/moehu-backend/src/main/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
024147c6-69ce-4c6f-a729-a7d9bfc3ec13
|
||||
1
moehu/moehu-backend/src/main/java/.pydio
Normal file
1
moehu/moehu-backend/src/main/java/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
9a9fa3f4-df77-42a9-915a-84ab161c5e92
|
||||
1
moehu/moehu-backend/src/main/java/com/.pydio
Normal file
1
moehu/moehu-backend/src/main/java/com/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
4ab65a99-7223-414f-81d0-a9d86b1cbfc3
|
||||
1
moehu/moehu-backend/src/main/java/com/moehu/.pydio
Normal file
1
moehu/moehu-backend/src/main/java/com/moehu/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
115fa556-aa70-49ff-a935-f4b8013a2e82
|
||||
1
moehu/moehu-backend/src/main/java/com/moehu/back/.pydio
Normal file
1
moehu/moehu-backend/src/main/java/com/moehu/back/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
d209785e-6829-40bf-bfed-53e8641442e9
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.moehu.back;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.util.unit.DataSize;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import javax.servlet.MultipartConfigElement;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.moehu.back.dao")
|
||||
@EnableSwagger2
|
||||
public class BackApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(BackApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.moehu.back;
|
||||
|
||||
import com.moehu.back.utils.IKAnalyzerSupport;
|
||||
import com.moehu.back.utils.MD5;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.wltea.analyzer.core.IKSegmenter;
|
||||
import org.wltea.analyzer.core.Lexeme;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@SpringBootTest
|
||||
@Slf4j
|
||||
class IkApplicationTests {
|
||||
|
||||
@Test
|
||||
void test() throws Exception {
|
||||
// String a = MD5.encode("111");
|
||||
// String text = "二次元世界的宅女";
|
||||
// List<String> a = IKAnalyzerSupport.iKSegmenterToList(text);
|
||||
String str = "Wed Apr 21 17:14:04 CST 2021";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
|
||||
Date date = (Date) sdf.parse(str);
|
||||
|
||||
String formatStr2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
|
||||
|
||||
log.info(" ===== {}", formatStr2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
509df3d3-8b3f-4b7f-82ac-885919373245
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.moehu.back.annotation;
|
||||
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@RestController
|
||||
@RequestMapping
|
||||
public @interface AdminRestController {
|
||||
/**
|
||||
* Alias for {@link RequestMapping#name}.
|
||||
*/
|
||||
@AliasFor(annotation = RequestMapping.class)
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* Alias for {@link RequestMapping#value}.
|
||||
*/
|
||||
@AliasFor(annotation = RequestMapping.class)
|
||||
String[] value() default {};
|
||||
|
||||
/**
|
||||
* Alias for {@link RequestMapping#path}.
|
||||
*/
|
||||
@AliasFor(annotation = RequestMapping.class)
|
||||
String[] path() default {};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.moehu.back.annotation;
|
||||
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@RestController
|
||||
@RequestMapping
|
||||
public @interface AppRestController {
|
||||
/**
|
||||
* Alias for {@link RequestMapping#name}.
|
||||
*/
|
||||
@AliasFor(annotation = RequestMapping.class)
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* Alias for {@link RequestMapping#value}.
|
||||
*/
|
||||
@AliasFor(annotation = RequestMapping.class)
|
||||
String[] value() default {};
|
||||
|
||||
/**
|
||||
* Alias for {@link RequestMapping#path}.
|
||||
*/
|
||||
@AliasFor(annotation = RequestMapping.class)
|
||||
String[] path() default {};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.moehu.back.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* PassToken 装饰器,用于某些接口跳过token认证
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface PassToken {
|
||||
boolean required() default true;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.moehu.back.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
|
||||
/**
|
||||
* UserLoginToken 装饰器,某些接口必须进行token认证
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface UserLoginToken {
|
||||
boolean required() default true;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
53908895-88d9-4a2d-8086-571143336296
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.moehu.back.config;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 设置请求基地址的前缀
|
||||
*/
|
||||
@Component("api.path")
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiPathProperties {
|
||||
|
||||
@Value("${api.path.app}")
|
||||
String appPrefix;
|
||||
|
||||
@Value("${api.path.admin}")
|
||||
String adminPrefix;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.moehu.back.config;
|
||||
|
||||
import com.moehu.back.annotation.AdminRestController;
|
||||
import com.moehu.back.annotation.AppRestController;
|
||||
import com.moehu.back.interceptor.AuthenticationInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Configuration
|
||||
public class ApiPathWebMvcConfigurer implements WebMvcConfigurer {
|
||||
|
||||
@Resource
|
||||
private ApiPathProperties apiPathProperties;
|
||||
|
||||
/**
|
||||
* 类上如果有
|
||||
* AppRestController,那么设置前缀 为 /app
|
||||
* AdminRestController,那么设置前缀 为 /admin
|
||||
* @param configurer
|
||||
*/
|
||||
@Override
|
||||
public void configurePathMatch(PathMatchConfigurer configurer) {
|
||||
configurer
|
||||
.addPathPrefix(apiPathProperties.getAppPrefix(),c -> c.isAnnotationPresent(AppRestController.class))
|
||||
.addPathPrefix(apiPathProperties.getAdminPrefix(),c -> c.isAnnotationPresent(AdminRestController.class));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 拦截所有请求,通过判断是否有 @LoginRequired 注解 决定是否需要登录
|
||||
* @param registry
|
||||
*/
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(authenticationInterceptor())
|
||||
.addPathPatterns("/**");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationInterceptor authenticationInterceptor() {
|
||||
return new AuthenticationInterceptor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/static/**")
|
||||
.addResourceLocations("classpath:/static/");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.moehu.back.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
|
||||
/**
|
||||
* 跨域配置
|
||||
*/
|
||||
@Configuration
|
||||
public class CorsConfig {
|
||||
private CorsConfiguration buildConfig() {
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
corsConfiguration.addAllowedOrigin("*"); // 允许任何域名
|
||||
corsConfiguration.addAllowedHeader("*"); // 允许任何头
|
||||
corsConfiguration.addAllowedMethod("*"); // 允许任何方法
|
||||
return corsConfiguration;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", buildConfig()); //注册
|
||||
return new CorsFilter(source);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.moehu.back.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
/**
|
||||
* Swagger 接口帮助文档
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.moehu.back.controller"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("萌弧App+Admin后台接口")
|
||||
.description("适用于萌弧的接口,前端使用!")
|
||||
.termsOfServiceUrl("http://www.spring.io")
|
||||
.version("0.0.1")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.moehu.back.config;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
public class WebLogAspect {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(WebLogAspect.class);
|
||||
|
||||
/** 以 controller 包下定义的所有请求为切入点 */
|
||||
@Pointcut("execution(public * com.moehu.back.controller..*.*(..))")
|
||||
public void webLog() {}
|
||||
|
||||
/**
|
||||
* 在切点之前织入
|
||||
*/
|
||||
@Before("webLog()")
|
||||
public void doBefore(JoinPoint joinPoint) throws Throwable {
|
||||
// 开始打印请求日志
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
|
||||
logger.info("========================================== Start ==========================================");
|
||||
logger.info("接口地址: : {}", request.getRequestURL().toString());
|
||||
logger.info("来源 IP: : {}", request.getRemoteAddr());
|
||||
logger.info("请求方法: : {}", request.getMethod());
|
||||
logger.info("请求入参 : {}", new Gson().toJson(joinPoint.getArgs()));
|
||||
logger.info("token 头: : {}", request.getHeader("token"));
|
||||
logger.info("控制器: : {}.{}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 环绕
|
||||
*/
|
||||
@Around("webLog()")
|
||||
public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
|
||||
long startTime = System.currentTimeMillis();
|
||||
Object result = proceedingJoinPoint.proceed();
|
||||
// 打印出参
|
||||
logger.info("响应参数 : {}", new Gson().toJson(result));
|
||||
// 执行耗时
|
||||
logger.info("请求耗时 : {} ms", System.currentTimeMillis() - startTime);
|
||||
logger.info("=========================================== End ===========================================");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
266d7275-efe8-4900-af7f-c0b07c9824d1
|
||||
@@ -0,0 +1 @@
|
||||
ba758d50-b4ed-4c08-867b-46e6f9089d88
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.moehu.back.controller.admin;
|
||||
|
||||
import com.moehu.back.annotation.AdminRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.model.OpusModel;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.response.OpusInfoResponseModel;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.service.impl.OpusServiceImpl;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/opus")
|
||||
@AdminRestController
|
||||
@Api(tags = "【管理后台】Opus 作品相关接口")
|
||||
public class AdminOpusController {
|
||||
|
||||
@Autowired
|
||||
OpusServiceImpl opusService;
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="作品审核接口", notes="作品审核接口,用于作品的审核")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_title", value = "作品标题", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "opus_status", value = "作品的审核状态。等待审核0,审核驳回-1,审核通过1", required = false, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "opus_type", value = "作品的分类,推荐1,排行2,关注3", required = false, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "opus_original", value = "作品是否原创 ,1原创,0 非原创", required = false, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = true, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = true, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
|
||||
@PostMapping("/OpusAudit")
|
||||
public ResultModel<PagingResponseModel<List<OpusModel>>> OpusAudit(@RequestBody Map<String, String> opus) {
|
||||
return opusService.OpusAudit(opus);
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="作品详情", notes="查看作品的详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id", required = true, dataType = "Number")
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/OpusInfo")
|
||||
public ResultModel<OpusInfoResponseModel> OpusInfo(@RequestBody Map<String, Integer> Opus) {
|
||||
return opusService.getOpusInfo(Opus.get("opus_id"), "static/admin");
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="通过 & 拒绝 审核接口", notes="作品审核接口,用于作品的通过 & 拒绝 审核")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "opus_status", value = "通过审核传:1,拒绝通过传:-1", required = true, dataType = "Number")
|
||||
})
|
||||
|
||||
@PostMapping("/Approved")
|
||||
public ResultModel<String> Approved(@RequestBody Map<String, Integer> opus) {
|
||||
return opusService.Approved(opus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.moehu.back.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.moehu.back.annotation.AdminRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.model.PagingModel;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.UpdateModel;
|
||||
import com.moehu.back.model.request.UpdateListRequest;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.service.impl.ToolServiceImpl;
|
||||
import com.moehu.back.utils.AliYunOSS.AliyunOSSUtil;
|
||||
import com.moehu.back.utils.ResultUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/tool")
|
||||
@AdminRestController
|
||||
@Api(tags = "Tool 公共类接口")
|
||||
public class AdminToolController {
|
||||
|
||||
|
||||
@Autowired
|
||||
ToolServiceImpl toolService;
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【管理后台使用】发布新的版本", notes="管理后台,管理员发布新版本使用")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "update_version", value = "app版本号,例如:1.0.1", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "update_version_code", value = "app版本的整数型,例如:101", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "update_down_url", value = "下载地址,先调用图片上传接口", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "update_content", value = "更新的功能说明,输入的内容请以|隔开", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "update_force", value = "是否需要强制升级 1需要,0不需要", required = true, dataType = "Number"),
|
||||
})
|
||||
@PostMapping("/addNewUpdate")
|
||||
public ResultModel<String> addNewUpdate(@RequestBody UpdateModel update) {
|
||||
return toolService.addNewUpdate(update);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【管理后台使用】获取所有App版本", notes="管理后台,获取所有App版本历史记录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "update_version", value = "app版本", required = true, dataType = "String", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "update_force", value = "是否需要强制更新 1 需要,0不需要", required = true, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = true, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = true, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
@PostMapping("/UpdateList")
|
||||
public ResultModel<PagingResponseModel<List<UpdateModel>>> UpdateList(@RequestBody UpdateListRequest page) {
|
||||
return toolService.getNewUpdate("all", page);
|
||||
}
|
||||
|
||||
|
||||
// TODO 还未掉接口
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【管理后台使用】删除App的版本", notes="管理后台,删除App的版本")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "update_id", value = "app版本的id", required = true, dataType = "String", defaultValue="1"),
|
||||
})
|
||||
@PostMapping("/deleteUpdate")
|
||||
public ResultModel<String> deleteUpdate(@RequestBody UpdateListRequest id) {
|
||||
return toolService.deleteUpdate(id.getUpdate_id());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="【管理后台使用】文件上传", notes="用来上传图片,文件等,前端$(\"input\")[0].files[0]后将数据append进new FormData()中,然后使用ajax上传。")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "文件的files数据,以FormData格式上传", required = true, dataType = "FormData"),
|
||||
})
|
||||
@PostMapping("/UploadFile")
|
||||
public ResultModel UploadFile(@RequestParam("file") MultipartFile file) {
|
||||
if (file.isEmpty()) {
|
||||
return ResultUtils.Success("请选择文件");
|
||||
}
|
||||
String uploadUrl = AliyunOSSUtil.upLoad(file);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("img_url", uploadUrl);
|
||||
return ResultUtils.Success(json);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.moehu.back.controller.admin;
|
||||
|
||||
import com.moehu.back.annotation.AdminRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.model.OpusModel;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.UserModel;
|
||||
import com.moehu.back.model.UserVerify;
|
||||
import com.moehu.back.model.request.UserVerifyRequest;
|
||||
import com.moehu.back.model.response.LoginResponseModel;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.model.response.admin.UserLoginModel;
|
||||
import com.moehu.back.service.impl.UserServiceImpl;
|
||||
import com.moehu.back.service.impl.admin.AdminUserServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/user")
|
||||
@AdminRestController
|
||||
@Api(tags = "【管理后台】User 用户相关接口")
|
||||
public class AdminUserController {
|
||||
|
||||
@Autowired
|
||||
private AdminUserServiceImpl adminUserService;
|
||||
|
||||
@Autowired
|
||||
private UserServiceImpl userService;
|
||||
|
||||
@ApiOperation(value="管理后台用户登录", notes="用户登录成功后,接口会返回token字段,需要前端自己存储,并在请求头 token 中携带")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "admin_user_name", value = "管理员登录用户名", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "admin_user_pwd", value = "管理员登录密码", required = true, dataType = "String")})
|
||||
@PostMapping("/Login")
|
||||
public ResultModel<LoginResponseModel<UserLoginModel>> Login(@RequestBody UserLoginModel User) {
|
||||
return adminUserService.login(User);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="管理后台用户注册", notes="管理后台用户注册")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "admin_user_name", value = "管理员用户名", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "admin_user_pwd", value = "管理员密码", required = true, dataType = "String")})
|
||||
@PostMapping("/Reg")
|
||||
public ResultModel Reg(@RequestBody UserLoginModel User) {
|
||||
return adminUserService.reg(User);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【管理后台】获取头像,签名,昵称审核的列表", notes="获取头像,签名,昵称审核的列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_id", value = "用户id", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "user_verify_status", value = "审核状态:0等待审核,1 审核通过, -1 审核拒绝", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "type", value = "需要请求的数据类型,取值:avatar(头像),nickname(昵称),signature(签名)", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = true, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
@PostMapping("/UserVerifyList")
|
||||
public ResultModel<PagingResponseModel<List<UserVerify>>> EditUserInfo(@RequestBody UserVerifyRequest user) {
|
||||
return userService.UserVerifyList(user);
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【管理后台】对 [UserVerifyList] 列表进行审核", notes="对 [UserVerifyList] 列表进行审核")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_verify_id", value = "审核列表的id", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "user_verify_status", value = "审核状态:1 通过审核, -1 审核拒绝", required = true, dataType = "Number"),
|
||||
})
|
||||
@PostMapping("/UserReview")
|
||||
public ResultModel<String> UserReview(@RequestBody Map<String, Integer> params) {
|
||||
return userService.UserReview(params);
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【管理后台】查看接口 [UserVerifyList] 的详情", notes="查看接口 [UserVerifyList] 的详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_verify_id", value = "用户昵称", required = true, dataType = "Number")
|
||||
})
|
||||
@PostMapping("/UserItemInfo")
|
||||
public ResultModel<UserModel> UserItemInfo(@RequestBody UserVerify user) {
|
||||
return userService.UserItemInfo(user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
094d4696-3907-40b5-ad50-d76377f2827d
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.moehu.back.controller.app;
|
||||
|
||||
import com.moehu.back.annotation.AppRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.controller.base.BaseService;
|
||||
import com.moehu.back.model.CommentModel;
|
||||
import com.moehu.back.model.PagingModel;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.UserModel;
|
||||
import com.moehu.back.model.response.LoginResponseModel;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.service.impl.CommentServiceImpl;
|
||||
import com.moehu.back.service.impl.UserServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/comment")
|
||||
@AppRestController
|
||||
@Api(tags = "Comment 评论相关的接口")
|
||||
public class CommentController extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private CommentServiceImpl commentService;
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【作品和动态共用】发布&回复评论", notes="用户发布评论(一级回复) & 回复某个人的评论(二级回复)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "评论作品时,必传作品的id,如果是动态页面那么该字段需要为:'' ", required = false, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "dynamic_id", value = "评论动态时,必传动态的id,如果是作品页面那么该字段需要为:'' ", required = false, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "comment_content", value = "评论的内容", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "comment_reply_id", value = "一级回复(发布评论)的时候默认传 0,二级回复时候永远传1级评论id", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "comment_to_username", value = "回复去向的用户名,例如,张三回复李四,那么传李四,用户发布评论的时候字段可以为空", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "comment_type", value = "评论的类型:1 作品的评论,2 动态的评论", required = true, dataType = "Number"),
|
||||
})
|
||||
@PostMapping("/add")
|
||||
public ResultModel pushComment(@RequestBody CommentModel comment) {
|
||||
return commentService.pushComment(comment);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="【作品和动态共用】获取所有评论", notes="获取作品和动态的所有评论")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "获取作品评论时,必传作品的id,如果是动态页面那么该字段需要为:'' ", required = false, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "dynamic_id", value = "获取动态评论时,必传动态的id,如果是作品页面那么该字段需要为:'' ", required = false, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
@ApiImplicitParam(name = "comment_type", value = "评论的类型:1 作品的评论,2 动态的评论", required = true, dataType = "Number"),
|
||||
})
|
||||
@PostMapping("/list")
|
||||
public ResultModel<PagingResponseModel<List<CommentModel>>> list(@RequestBody Map<String, Integer> Opus) {
|
||||
if (Opus.get("page")==null) {
|
||||
Opus.put("page",1);
|
||||
}
|
||||
|
||||
if (Opus.get("count") == null) {
|
||||
Opus.put("count",15);
|
||||
}
|
||||
return commentService.all(Opus);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【作品和动态共用】删除评论", notes="删除评论")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id", required = true, dataType = "Number"),
|
||||
|
||||
@ApiImplicitParam(name = "comment_id", value = "评论的id", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "level", value = "被删除评论的等级,取值范围:1(一级评论),2:(二级评论)", required = true, dataType = "Number"),
|
||||
})
|
||||
@PostMapping("/delete")
|
||||
public ResultModel<List<CommentModel>> delete(@RequestBody Map<String, Integer> Comment) {
|
||||
return commentService.delete(Comment);
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【作品和动态共用】举报评论", notes="用户举报某条评论")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "comment_id", value = "评论的id", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "report_text", value = "举报的原因", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping("/report")
|
||||
public ResultModel<List<CommentModel>> report(@RequestBody Map<String, Integer> Comment) {
|
||||
return commentService.report(Comment);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.moehu.back.controller.app;
|
||||
|
||||
|
||||
import com.moehu.back.annotation.AppRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.dao.DynamicDao;
|
||||
import com.moehu.back.model.*;
|
||||
import com.moehu.back.model.request.DynamicPushModel;
|
||||
import com.moehu.back.model.response.LoginResponseModel;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.model.response.UserInfoResponseModel;
|
||||
import com.moehu.back.service.impl.DynamicServiceImpl;
|
||||
import com.moehu.back.service.impl.OpusServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/dynamic")
|
||||
@AppRestController
|
||||
@Api(tags = "Dynamic 动态相关的接口")
|
||||
public class DynamicController {
|
||||
|
||||
@Autowired
|
||||
DynamicServiceImpl dynamicService;
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】发布动态", notes="发布新的普通动态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dynamic_introduce", value = "动态的内容", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "dynamic_imgs", value = "动态的图片数组,例如:['地址1','地址2','地址3']", required = true, dataType = "String[]")})
|
||||
@PostMapping("/Push")
|
||||
public ResultModel<String> Push(@RequestBody DynamicPushModel dy) {
|
||||
return dynamicService.addDynamic(dy);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="个人空间的 动态", notes="获取个人空间的动态,注意:只获取用户自己发布的动态,前端根据接口中返回的dynamic_type 决定进入不同的页面。dynamic_type 为1传入opus_id进入作品详情页面,如果为0传入dynamic_id进入动态详情页。")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
@ApiImplicitParam(name = "userid", value = "用户的user_id", required = true, dataType = "Number", defaultValue=""),
|
||||
})
|
||||
@PostMapping("/PersonalDynamic")
|
||||
public ResultModel<PagingResponseModel<List<DynamicModel>>> PersonalDynamic(@RequestBody PagingModel pagingModel) {
|
||||
if (pagingModel.getCount()==null) {
|
||||
pagingModel.setCount(15);
|
||||
}
|
||||
|
||||
if (pagingModel.getPage()==null) {
|
||||
pagingModel.setPage(1);
|
||||
}
|
||||
return dynamicService.personalDynamic(pagingModel);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="底部Tabs动态", notes="获取底部Tabs导航中的动态列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
@PostMapping("/TabsDynamic")
|
||||
public ResultModel<PagingResponseModel<List<DynamicModel>>> TabsDynamic(@RequestBody PagingModel pagingModel) {
|
||||
if (pagingModel.getCount()==null) {
|
||||
pagingModel.setCount(15);
|
||||
}
|
||||
|
||||
if (pagingModel.getPage()==null) {
|
||||
pagingModel.setPage(1);
|
||||
}
|
||||
return dynamicService.TabsDynamic(pagingModel);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="普通动态的详情", notes="进入普通动态的详情,投稿动态需要进入作品详情页,这个接口不负责!")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dynamic_id", value = "动态的id", required = true, dataType = "Number")
|
||||
})
|
||||
@PostMapping("/Info")
|
||||
public ResultModel<PagingResponseModel<List<DynamicModel>>> DynamicInfo(@RequestBody Map<String, Integer> dynamic) {
|
||||
return dynamicService.dynamicInfo(dynamic.get("dynamic_id"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】动态中,记录用户访问记录", notes="用户进入普通动态详情,和投稿动态详情的时候记录用户访问记录。注意:1:如果用户未登录查看动态详情,那么不调用接口。2:投稿动态也属于动态,但是投稿动态的详情页是作品详情页面,所以需要在作品详情里面判断,是否从动态中进入,如果是调用接口,如果不是不调用接口!!")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_to_id", value = "被查看的用户的id", required = true, dataType = "Number"),
|
||||
})
|
||||
@PostMapping("/RecordHistory")
|
||||
public ResultModel<String> RecordHistory(@RequestBody Map<String, Integer> dynamic) {
|
||||
return dynamicService.recordHistory(dynamic.get("user_to_id"));
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】获取【最常访问】用户列表", notes="底部Tabs的动态中获取【最常访问】,前端页面只需要显示5条数据,所以 count 可以传5参数!点击查看更多后 count 可以传 15")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
@PostMapping("/DynamicHistory")
|
||||
public ResultModel<PagingResponseModel<List<UserInfoResponseModel>>> GetDynamicHistory(@RequestBody PagingModel pagingModel) {
|
||||
if (pagingModel.getCount()==null) {
|
||||
pagingModel.setCount(15);
|
||||
}
|
||||
|
||||
if (pagingModel.getPage()==null) {
|
||||
pagingModel.setPage(1);
|
||||
}
|
||||
|
||||
return dynamicService.getDynamicHistory(pagingModel.getPage(), pagingModel.getCount());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,339 @@
|
||||
package com.moehu.back.controller.app;
|
||||
|
||||
import com.moehu.back.annotation.AppRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.model.OpusModel;
|
||||
import com.moehu.back.model.PagingModel;
|
||||
import com.moehu.back.model.PushOpusModel;
|
||||
import com.moehu.back.model.response.OpusInfoResponseModel;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.response.RankingResponseModel;
|
||||
import com.moehu.back.service.impl.OpusServiceImpl;
|
||||
import com.moehu.back.utils.IpUtil;
|
||||
import com.moehu.back.utils.Tool;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/opus")
|
||||
@AppRestController
|
||||
@Api(tags = "Opus 作品相关的接口")
|
||||
public class OpusController {
|
||||
|
||||
|
||||
@Autowired
|
||||
OpusServiceImpl opusService;
|
||||
|
||||
|
||||
@ApiOperation(value="获取【推荐】的作品", notes="获取首页【推荐】的作品数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
})
|
||||
@PostMapping("/Recommend")
|
||||
public ResultModel<PagingResponseModel<List<OpusModel>>> RecommendOpus(@RequestBody PagingModel pagingModel) {
|
||||
if (pagingModel.getCount()==null) { pagingModel.setCount(15); }
|
||||
if (pagingModel.getPage()==null) { pagingModel.setPage(1); }
|
||||
return opusService.OpusList(pagingModel);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】获取【关注】的作品", notes="获取首页用户【关注】的作品数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/Follow")
|
||||
public ResultModel<PagingResponseModel<List<OpusModel>>> FollowOpus(@RequestBody PagingModel pagingModel) {
|
||||
if (pagingModel.getCount()==null) {
|
||||
pagingModel.setCount(15);
|
||||
}
|
||||
|
||||
if (pagingModel.getPage()==null) {
|
||||
pagingModel.setPage(1);
|
||||
}
|
||||
|
||||
return opusService.FollowOpusList(pagingModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="获取【排行】的作品", notes="获取首页用户【排行】的作品数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/Ranking")
|
||||
public ResultModel<PagingResponseModel<List<RankingResponseModel>>> RankingOpus(@RequestBody PagingModel pagingModel) {
|
||||
if (pagingModel.getCount()==null) {
|
||||
pagingModel.setCount(15);
|
||||
}
|
||||
|
||||
if (pagingModel.getPage()==null) {
|
||||
pagingModel.setPage(1);
|
||||
}
|
||||
|
||||
return opusService.RankingOpusList(pagingModel);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】关注和取消关注接口", notes="如果用户没有被关注,那么调用本接口就会关注用户,反之如果已经关注过了,那么就会取消关注")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_to_id", value = "被关注用户的user_id", required = true, dataType = "Number")
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/FollowUser")
|
||||
public ResultModel FollowUser(@RequestBody Map<String, Integer> User) {
|
||||
return opusService.addFollowUser(User.get("user_to_id"));
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】检查当前用户是否被关注", notes="传入被关注的用户user_to_id,如果被关注了返回 true,如果没有被关注那么返回 false")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_to_id", value = "被关注用户的user_id", required = true, dataType = "Number")
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/CheckUserIsFollow")
|
||||
public ResultModel CheckUserIsFollow(@RequestBody Map<String, Integer> User) {
|
||||
return opusService.checkUserIsFollow(User.get("user_to_id"));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="作品详情", notes="查看某个作品的详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id", required = true, dataType = "Number")
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/OpusInfo")
|
||||
public ResultModel<OpusInfoResponseModel> OpusInfo(@RequestBody Map<String, Integer> Opus) {
|
||||
return opusService.getOpusInfo(Opus.get("opus_id"), "app");
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】收藏 & 取消收藏 作品", notes="如果作品未被收藏,那么进行收藏。如果收藏过了,那么调用该接口就取消收藏!")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "被收藏的作品id", required = true, dataType = "Number")
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/CollectionOpus")
|
||||
public ResultModel collectionOpus(@RequestBody Map<String, Integer> Opus) {
|
||||
return opusService.collectionOpus(Opus.get("opus_id"));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="获取用户收藏的作品列表", notes="个人空间获取收藏列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
@ApiImplicitParam(name = "userid", value = "用户的user_id", required = true, dataType = "Number", defaultValue=""),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/CollectionOpusList")
|
||||
public ResultModel<PagingResponseModel<List<OpusModel>>> collectionOpusList(@RequestBody PagingModel pagingModel) {
|
||||
if (pagingModel.getCount()==null) { pagingModel.setCount(15); }
|
||||
if (pagingModel.getPage()==null) { pagingModel.setPage(1); }
|
||||
return opusService.collectionOpusList(pagingModel);
|
||||
}
|
||||
|
||||
@ApiOperation(value="获取用户收藏作品的详情", notes="点击收藏列表的图片,获取详情数据(只返回作品的图片)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id", required = true, dataType = "Number", defaultValue="1"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/CollectionOpusInfo")
|
||||
public ResultModel collectionOpusInfo(@RequestBody Map<String, Integer> Opus) {
|
||||
return opusService.collectionOpusInfo(Opus.get("opus_id"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="个人空间获取投稿", notes="个人空间获取投稿")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "Number", defaultValue="15"),
|
||||
@ApiImplicitParam(name = "userid", value = "用户的user_id", required = true, dataType = "Number", defaultValue=""),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/OpusList")
|
||||
public ResultModel MyOpusList(@RequestBody PagingModel user) {
|
||||
return opusService.MyOpusList(user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】点赞 & 取消点赞接口", notes="对作品 & 动态进行点赞 和 取消点赞")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id,如果点赞动态那么这里为空字符串:'' ", required = true, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "dynamic_id", value = "动态的id,如果点赞作品那么这里为空字符串:''", required = true, dataType = "Number", defaultValue="1"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/UpvoteOpus")
|
||||
public ResultModel upvoteOpus(@RequestBody Map<String, String> Opus) {
|
||||
return opusService.upvoteOpus(Opus);
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】检查作品 & 动态是否被点赞", notes="主要用于进入详情页后检查作品 & 动态 是否被点赞,true表示点赞过了,false 表示未被点赞")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id,如果点赞动态那么这里为空字符串:'' ", required = true, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "dynamic_id", value = "动态的id,如果点赞作品那么这里为空字符串:''", required = true, dataType = "Number", defaultValue="1"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/CheckIsUpvote")
|
||||
public ResultModel checkOpusIsUpvote(@RequestBody Map<String, String> Opus) {
|
||||
return opusService.checkOpusIsUpvote(Opus.get("opus_id"), Opus.get("dynamic_id"));
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】发布作品", notes="用户发布作品接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_title", value = "作品的标题", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "opus_introduce", value = "作品的介绍", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "opus_tags", value = "作品的标签数组,例如:['娱乐','大雄','小夫']", required = true, dataType = "Array"),
|
||||
@ApiImplicitParam(name = "opus_imgs", value = "作品的图片数组,例如:['地址1','地址2','地址3']", required = true, dataType = "Array"),
|
||||
@ApiImplicitParam(name = "opus_jurisdiction", value = "作品公开范围,1所有人,2好友,3不公开", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "opus_original", value = "作品是否原创 ,1原创,0非原创", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "opus_time", value = "作品指定发布时间", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "opus_syncDynamic", value = "前端显示 开关按钮 样式,按钮打开状态:传 true,表示需要同步作品到动态中,否则传 false", required = true, dataType = "Number"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/PushOpus")
|
||||
public ResultModel pushOpus(@RequestBody PushOpusModel Opus) {
|
||||
return opusService.pushOpus(Opus);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】检查作品是否被收藏", notes="用于作品详情页,检查作品是否被收藏,true表示点收藏过了,false 表示未被收藏")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的id", required = true, dataType = "Number")
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/CheckOpusIsCollection")
|
||||
public ResultModel CheckOpusIsCollection(@RequestBody Map<String, Integer> Opus) {
|
||||
return opusService.checkOpusIsCollection(Opus.get("opus_id"));
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】作品的搜索", notes="用于作品相关的检索,数据来源从作品,用户,标签/话题 中来!")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(
|
||||
name = "keyword",
|
||||
value = "搜索关键字,Flutter需要使用 convert.base64Encode(convert.utf8.encode('中文')); 进行Base64编码,然后传递给后端!",
|
||||
required = true,
|
||||
dataType = "String"
|
||||
),
|
||||
@ApiImplicitParam(
|
||||
name = "type",
|
||||
value = "搜索的类型,取值:作品 opus,用户 user,标签 tag", required = true, dataType = "String"
|
||||
),
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = false, dataType = "String", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = false, dataType = "String", defaultValue="15"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/OpusSearch")
|
||||
public ResultModel OpusSearch(@RequestBody Map<String, String> Opus) throws Exception {
|
||||
// 5aSn6ZuE
|
||||
if (Opus.get("page")==null) { Opus.put("page", "1"); }
|
||||
if (Opus.get("count")==null) { Opus.put("count", "15"); }
|
||||
|
||||
Opus.put("keyword", Tool.decodeBase64(Opus.get("keyword")));
|
||||
return opusService.OpusSearch(Opus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package com.moehu.back.controller.app;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.moehu.back.annotation.AppRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.model.OpusModel;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.TagModel;
|
||||
import com.moehu.back.model.request.CreatedOpusInfoTagModel;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.service.impl.TagServiceImpl;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Array;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/tag")
|
||||
@AppRestController
|
||||
@Api(tags = "Tag 标签相关的接口")
|
||||
public class TagController {
|
||||
|
||||
@Autowired
|
||||
TagServiceImpl tagService;
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】删除标签", notes="主要是给用户用来删除标签")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tags_id", value = "被删除的标签id", required = true, dataType = "Number", defaultValue="1"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/DeleteTag")
|
||||
public ResultModel deleteTag(@RequestBody Map<String, Integer> tag) {
|
||||
return tagService.deleteTag(tag.get("tags_id"));
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】编辑标签", notes="主要用来修改标签的文字,例如将:'二次元' 修改为 '二次元世界' ")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tags_id", value = "被修改的标签id", required = true, dataType = "Number", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "tags_title", value = "被修改成的文字", required = true, dataType = "String", defaultValue="二次元世界"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/EditTag")
|
||||
public ResultModel editTag(@RequestBody Map<String, String> tag) {
|
||||
return tagService.editTag(Integer.parseInt(tag.get("tags_id")), tag.get("tags_title"));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="获取推荐标签", notes="用户在发布作品的时候用来获取推荐的标签")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/RecommendTag")
|
||||
public ResultModel<List<TagModel>> RecommendTag() {
|
||||
return tagService.RecommendTag();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】发布作品的时候创建标签接口", notes="发布作品的时候创建标签接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tag_arr", value = "标签名组成的数组,tag_arr 示例:['娱乐','原创','二次元']", required = true, dataType = "Array<String>", defaultValue="['大雄','静香','小夫','原创']"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/CreatedTags")
|
||||
public ResultModel CreatedTags(@RequestBody Map<String, String[]> tag) {
|
||||
return tagService.createdTag(tag.get("tag_arr"));
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】作品详情页编辑标签接口", notes="作品详情页编辑标签接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tags_title", value = "中文标签名", required = true, dataType = "String", defaultValue="['大雄','静香','小夫','原创']"),
|
||||
@ApiImplicitParam(name = "user_id", value = "用户id", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品id", required = true, dataType = "Number"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/OpusInfoCreatedTags")
|
||||
public ResultModel OpusInfoCreatedTags(@RequestBody CreatedOpusInfoTagModel tag) {
|
||||
return tagService.createdOpusInfoTag(tag);
|
||||
}
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】更新作品详情页是否允许编辑的状态", notes="更新 允许其他会员添加标签")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品id", required = true, dataType = "Number"),
|
||||
@ApiImplicitParam(name = "edit_status", value = "编辑的状态,1 表示开启允许编辑,0 表示关闭允许编辑",
|
||||
required = true, dataType = "Number"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/UpdateTagsEditStatus")
|
||||
public ResultModel UpdateTagsEditStatus(@RequestBody Map<String, Integer> tag) {
|
||||
return tagService.UpdateTagsEditStatus(tag);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="【需要Token】获取用户创建的所有标签", notes="主要用来获取用户创建过的所有标签")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/UserTagList")
|
||||
public ResultModel<List<TagModel>> UserTagList() {
|
||||
return tagService.userTagList();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="获取作品的标签", notes="作品详情页需要使用到做的标签功能")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "opus_id", value = "作品的opus_id 参数", required = true, dataType = "Number", defaultValue="1"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/OpusTag")
|
||||
public ResultModel<List<TagModel>> OpusTag(@RequestBody Map<String, Integer> Opus) {
|
||||
return tagService.OpusTag(Opus.get("opus_id"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="获取标签下作品列表", notes="用户点击标签的时候,获取该标签下有多少作品")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tags_title", value = "标签的中文名称,前端Flutter需要使用 convert.base64Encode(convert.utf8.encode(tags_title)); 进行Base64编码,然后传递给后端!",
|
||||
required = true, dataType = "String", defaultValue="小夫"),
|
||||
@ApiImplicitParam(name = "page", value = "分页的页数", required = true, dataType = "Number", defaultValue="1"),
|
||||
})
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "请求成功"),
|
||||
@ApiResponse(code = 500, message = "缺少token,请登录"),
|
||||
@ApiResponse(code = 500, message = "无效token,请勿伪造token"),
|
||||
@ApiResponse(code = 500, message = "用户不存在,请重新登录")
|
||||
})
|
||||
@PostMapping("/TagOpusList")
|
||||
public ResultModel<PagingResponseModel<List<OpusModel>>> TagOpusList(@RequestBody JSONObject params) throws UnsupportedEncodingException {
|
||||
|
||||
byte[] asBytes = Base64.getDecoder().decode((params.get("tags_title").toString()));
|
||||
params.put("tags_title", new String(asBytes, "utf-8"));
|
||||
|
||||
if (params.get("page") == null) {
|
||||
params.put("page", 1);
|
||||
}
|
||||
|
||||
return tagService.TagOpusList(
|
||||
params.get("tags_title").toString(),
|
||||
Integer.parseInt(params.get("page").toString())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.moehu.back.controller.app;
|
||||
|
||||
import com.moehu.back.annotation.AppRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.controller.base.BaseService;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.UserModel;
|
||||
import com.moehu.back.model.response.LoginResponseModel;
|
||||
import com.moehu.back.model.response.OpusSearchUser;
|
||||
import com.moehu.back.service.impl.UserServiceImpl;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/user")
|
||||
@AppRestController
|
||||
@Api(tags = "User 用户相关的接口")
|
||||
public class UserController extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private UserServiceImpl userService;
|
||||
|
||||
@ApiOperation(value="用户登录", notes="用户登录成功后,接口会返回token字段,需要前端自己存储,并在请求头 token 中携带")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_phone", value = "手机号(前端自己验证手机号合法性)", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "sms_code", value = "短信验证码", required = true, dataType = "String")})
|
||||
@PostMapping("/Login")
|
||||
public ResultModel<LoginResponseModel<UserModel>> Login(@RequestBody UserModel User) {
|
||||
return userService.UserLogin(User);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="用户注册", notes="用户注册接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_nickname", value = "昵称",
|
||||
required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "user_phone", value = "手机号(前端自己验证手机号合法性)",
|
||||
required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "sms_code", value = "短信验证码", required = true, dataType = "String")
|
||||
})
|
||||
@PostMapping("/Reg")
|
||||
public ResultModel<LoginResponseModel<UserModel>> Register(@RequestBody UserModel User) {
|
||||
return userService.UserRegister(User);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="获取用户的基本信息", notes="传入用户的user_id,获取用户的个人空间基本信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_id", value = "用户的user_id", required = true, dataType = "Number"),
|
||||
})
|
||||
@PostMapping("/UserInfo")
|
||||
public ResultModel<LoginResponseModel<UserModel>> UserInfo(@RequestBody UserModel User) {
|
||||
return userService.UserInfo(User);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="个人空间【关注】获取我关注的所有用户", notes="传入用户的user_id,获取我关注的所有用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_id", value = "用户的user_id", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = true, dataType = "String", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = true, dataType = "String", defaultValue="15"),
|
||||
})
|
||||
@PostMapping("/FollowUserList")
|
||||
public ResultModel<LoginResponseModel<OpusSearchUser>> FollowUserList(@RequestBody Map<String,String> User) {
|
||||
return userService.FollowUserList(User);
|
||||
}
|
||||
|
||||
@ApiOperation(value="个人空间【粉丝】获取关注我的粉丝", notes="传入用户的user_id,获取关注我的粉丝")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_id", value = "用户的user_id", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "page", value = "请求的页数", required = true, dataType = "String", defaultValue="1"),
|
||||
@ApiImplicitParam(name = "count", value = "每页作品数,默认15", required = true, dataType = "String", defaultValue="15"),
|
||||
})
|
||||
@PostMapping("/FansUserList")
|
||||
public ResultModel<LoginResponseModel<OpusSearchUser>> FansUserList(@RequestBody Map<String,String> User) {
|
||||
return userService.FansUserList(User);
|
||||
}
|
||||
|
||||
|
||||
@UserLoginToken
|
||||
@ApiOperation(value="用于编辑个人资料", notes="编辑个人资料接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "user_head_img", value = "头像的图片地址,如果用户没有修改,默认数值传空字符串: '' ", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "user_nickname", value = "昵称,如果用户没有修改,默认数值传空字符串: '' ", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "user_autograph", value = "简介,也就是签名,如果用户没有修改,默认数值传空字符串: '' ", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "user_sex", value = "性别,如果用户没有修改,默认数值传空字符串: ''", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "user_birthday", value = "出生日期,格式:1995-03-24,如果用户没有修改,默认数值传空字符串: '' ", required = true, dataType = "String"),
|
||||
// @ApiImplicitParam(name = "user_address", value = "地区", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping("/EditUserInfo")
|
||||
public ResultModel<LoginResponseModel<UserModel>> EditUserInfo(@RequestBody UserModel User) {
|
||||
return userService.EditUserInfo(User);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
508a191c-4308-4b28-9643-ce6cd4d0176b
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.moehu.back.controller.base;
|
||||
|
||||
import com.moehu.back.service.TokenService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class BaseService {
|
||||
@Autowired
|
||||
public TokenService tokenService;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.moehu.back.controller.base;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.moehu.back.annotation.AppRestController;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.model.*;
|
||||
import com.moehu.back.model.request.UpdateListRequest;
|
||||
import com.moehu.back.model.response.PagingResponseModel;
|
||||
import com.moehu.back.service.impl.ToolServiceImpl;
|
||||
import com.moehu.back.utils.AliYunOSS.AliyunOSSUtil;
|
||||
import com.moehu.back.utils.ResultUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/tool")
|
||||
@AppRestController
|
||||
@Api(tags = "Tool 公共类接口")
|
||||
public class ToolController {
|
||||
|
||||
@Autowired
|
||||
ToolServiceImpl toolService;
|
||||
|
||||
@ApiOperation(value="文件上传", notes="用来上传图片,文件等,前端$(\"input\")[0].files[0]后将数据append进new FormData()中,然后使用ajax上传。")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "文件的files数据,以FormData格式上传", required = true, dataType = "FormData"),
|
||||
})
|
||||
@PostMapping("/UploadFile")
|
||||
public ResultModel UploadFile(@RequestParam("file") MultipartFile file) {
|
||||
if (file.isEmpty()) {
|
||||
return ResultUtils.Success("请选择文件");
|
||||
}
|
||||
String uploadUrl = AliyunOSSUtil.upLoad(file);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("img_url", uploadUrl);
|
||||
return ResultUtils.Success(json);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="短信验证码", notes="用于向用户发送短信验证码,注意阿里云短信审核未通过,请勿调用该接口,但是前端短信验证码请传固定值:1314")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "phone", value = "用户手机号", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping("/SmsCode")
|
||||
public ResultModel SmsCode(String phone) {
|
||||
return ResultUtils.Success("json");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="【app端使用】app升级检测", notes="后端返回最新的app版本,前端使用字段:update_version_code 和本地app的code进行对比,决定是否需要升级,同时根据update_force 字段决定是否强制升级,update_force取值:1 需要强制升级,0 不需要")
|
||||
@PostMapping("/Update")
|
||||
public ResultModel<UpdateModel> Update() {
|
||||
UpdateListRequest page = new UpdateListRequest();
|
||||
return toolService.getNewUpdate("one", page);
|
||||
}
|
||||
|
||||
@ApiOperation(value="【app端使用】记录版本的下载次数", notes="当前端用户点击升级弹窗的 确定 或 下载 按钮时调用这个接口")
|
||||
@PostMapping("/addUpdateCount")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "update_id", value = "从 /Update 接口中获取", required = true, dataType = "String"),
|
||||
})
|
||||
public ResultModel<String> addUpdateCount(@RequestBody UpdateModel update) {
|
||||
return toolService.addUpdateCount(update);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
acce1295-72ab-4edc-8a2c-1a327ced4b90
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.moehu.back.dao;
|
||||
|
||||
import com.moehu.back.model.CommentModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CommentDao {
|
||||
Integer add(CommentModel comment);
|
||||
List<CommentModel> all(Integer opus_id);
|
||||
Integer delete(Integer level, Integer opus_id, Integer comment_id);
|
||||
Integer report(Integer comment_id);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.moehu.back.dao;
|
||||
|
||||
import com.moehu.back.model.DynamicModel;
|
||||
import com.moehu.back.model.ImgModel;
|
||||
import com.moehu.back.model.PagingModel;
|
||||
import com.moehu.back.model.expand.DynamiciImgModel;
|
||||
import com.moehu.back.model.request.DynamicPushModel;
|
||||
import com.moehu.back.model.response.UserInfoResponseModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface DynamicDao {
|
||||
|
||||
Integer addDynamic(DynamicModel dy);
|
||||
Integer addOrdinaryDynamic(DynamicModel dy);
|
||||
Integer DynamicCreatedImg(List<ImgModel> img);
|
||||
DynamiciImgModel DynamicInfo(Integer id);
|
||||
List<DynamicModel> getPersonalDynamic(PagingModel dynamic);
|
||||
List<DynamicModel> getFollowUserDynamic(List<Integer> userToId);
|
||||
ImgModel getDynamicImg(Integer id);
|
||||
List<ImgModel> selectDynamicImgList(Integer id);
|
||||
UserInfoResponseModel getUserInfo(Integer userid);
|
||||
Map getMainImg(Integer opus_id);
|
||||
Integer recordHistoryDao(Integer user_id, Integer user_to_id);
|
||||
List<Integer> getUserHistory(Integer id);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.moehu.back.dao;
|
||||
import com.moehu.back.model.*;
|
||||
import com.moehu.back.model.response.OpusInfoResponseModel;
|
||||
import com.moehu.back.model.response.OpusSearchUser;
|
||||
import com.moehu.back.model.response.RankingResponseModel;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface OpusDao {
|
||||
List<OpusModel> getOpusList();
|
||||
List<OpusModel> getFollowList(List<Integer> ids);
|
||||
List<Integer> getUserFollowId(Integer id);
|
||||
List<RankingResponseModel> getRankingOpusList();
|
||||
Integer addFollowUser(Integer user_source_id, Integer user_to_id);
|
||||
Integer cancelFollowUser(Integer user_source_id, Integer user_to_id);
|
||||
Integer checkFollowUser(Integer user_source_id, Integer user_to_id);
|
||||
OpusInfoResponseModel getOpusInfo(Integer id);
|
||||
List<CommentModel> getUserComment(Integer opus_id, Integer dynamic_id, Integer comment_type);
|
||||
List<CommentModel> getReplyComment(Integer id);
|
||||
List<OpusModel> getNewsOpus(Integer user_id, Integer opus_id);
|
||||
Integer CollectionOpus(Integer user_id, Integer opus_id);
|
||||
Integer cancelCollectionOpus(Integer user_id, Integer opus_id);
|
||||
List<Map<String, Integer>> getCollectionUserId(Integer user_id);
|
||||
List<OpusModel> OpusList(Integer user_id);
|
||||
List<OpusModel> MyOpusList(Integer user_id);
|
||||
Integer upvoteOpus(Integer user_id, Integer opus_id);
|
||||
Integer upvoteDynamic(Integer user_id, Integer dynamic_id);
|
||||
|
||||
Integer updateOpusStatus(Integer opus_id, Integer opus_status);
|
||||
Integer deleteUpvoteOpus(Integer user_id, Integer opus_id);
|
||||
Integer deleteUpvoteDynamic(Integer user_id, Integer dynamic_id);
|
||||
|
||||
Integer addUpvoteOpus(Integer user_id, Integer opus_id);
|
||||
Integer addUpvoteDynamic(Integer user_id, Integer dynamic_id);
|
||||
|
||||
|
||||
Integer reduceUpvoteCount(Integer opus_id);
|
||||
Integer reduceUpvoteDynamicCount(Integer dynamic_id);
|
||||
|
||||
Integer addUpvoteCount(Integer opus_id);
|
||||
Integer UpvoteDynamicCount(Integer dynamic_id);
|
||||
|
||||
List<ImgModel> collectionOpusInfo(Integer opus_id);
|
||||
Integer addSeeCount(Integer opus_id);
|
||||
Integer addCollectionCount(Integer opus_id);
|
||||
Integer reduceCollectionCount(Integer opus_id);
|
||||
List<ImgModel> getOpusImg(Integer opus_id);
|
||||
Integer isSeeOpus(String see_address, Integer opus_id);
|
||||
Integer addOpus(PushOpusModel opus);
|
||||
Integer OpusCreatedTag(List<TagModel> tag);
|
||||
Integer OpusCreatedImg(List<ImgModel> img);
|
||||
Integer checkOpusIsCollection(Integer opus_id, Integer user_id);
|
||||
List<OpusModel> OpusSearch(List<String> keyword);
|
||||
List<OpusSearchUser> UserSearch(List<String> keyword);
|
||||
List<OpusModel> TagSearch(List<String> keyword);
|
||||
List<OpusModel> opusAudit(String opus_title, String opus_status, String opus_type, String opus_original);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.moehu.back.dao;
|
||||
|
||||
import com.moehu.back.model.OpusModel;
|
||||
import com.moehu.back.model.ResultModel;
|
||||
import com.moehu.back.model.TagModel;
|
||||
import com.moehu.back.model.request.CreatedOpusInfoTagModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TagDao {
|
||||
List<TagModel> getRecommendTag();
|
||||
List<TagModel> getOpusTag(Integer opus_id);
|
||||
List<OpusModel> getTagOpusList(String tags_title);
|
||||
Integer createdTag(Integer user_id, String[] tags_list);
|
||||
List<TagModel> getUserTagList(Integer user_id);
|
||||
boolean editTag(Integer tag_id, Integer user_id, String title);
|
||||
boolean deleteTag(Integer tag_id, Integer user_id);
|
||||
Integer addOpusInfoTag(CreatedOpusInfoTagModel tag);
|
||||
boolean udateTagEditStatus(Integer user_id, Integer opus_id, Integer edit_status);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.moehu.back.dao;
|
||||
import com.moehu.back.model.UpdateModel;
|
||||
import com.moehu.back.model.request.UpdateListRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ToolDao {
|
||||
UpdateModel getNewUpdate();
|
||||
List<UpdateModel> getAllUpdate(UpdateListRequest update);
|
||||
Integer addNewUpdate(UpdateModel update);
|
||||
Integer addUpdateCount(UpdateModel update);
|
||||
Integer deleteUpdate(Integer id);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.moehu.back.dao;
|
||||
|
||||
import com.moehu.back.model.UserModel;
|
||||
import com.moehu.back.model.UserVerify;
|
||||
import com.moehu.back.model.request.UserVerifyRequest;
|
||||
import com.moehu.back.model.response.OpusSearchUser;
|
||||
import com.moehu.back.model.response.admin.UserLoginModel;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
import java.util.List;
|
||||
|
||||
public interface UserDao {
|
||||
List<UserModel> allUser();
|
||||
UserModel getFindById(int id);
|
||||
|
||||
Integer getFansNums(int id);
|
||||
Integer getSatisfiedNums(int id);
|
||||
Integer getFollowNums(int id);
|
||||
Integer UpdateUserInfo(UserModel user);
|
||||
Integer UpdateUserTableItem(UserVerify user);
|
||||
|
||||
Integer UpdateVerifyStatus(int user_verify_id, int user_verify_status);
|
||||
UserVerify UserItemInfo(UserVerify user);
|
||||
UserModel UserVerifyOneInfo(UserVerify user);
|
||||
List<OpusSearchUser> FollowUserList(Integer user_id);
|
||||
List<OpusSearchUser> FansUserList(Integer user_id);
|
||||
List<UserVerify> UserVerifyList(UserVerifyRequest user);
|
||||
Integer insertVerify(Integer user_id, String user_head_img, String user_nickname, String user_autograph);
|
||||
|
||||
UserModel login(UserModel userModel);
|
||||
int userRegister(UserModel userModel);
|
||||
|
||||
UserLoginModel adminLogin(UserLoginModel user);
|
||||
Integer adminReg(UserLoginModel user);
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
f8d31e21-51d1-4760-aaa0-797ba5df8777
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.moehu.back.interceptor;
|
||||
|
||||
import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.JWTVerifier;
|
||||
import com.auth0.jwt.algorithms.Algorithm;
|
||||
import com.auth0.jwt.exceptions.JWTDecodeException;
|
||||
import com.auth0.jwt.exceptions.JWTVerificationException;
|
||||
import com.moehu.back.annotation.PassToken;
|
||||
import com.moehu.back.annotation.UserLoginToken;
|
||||
import com.moehu.back.dao.UserDao;
|
||||
import com.moehu.back.model.UserModel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* 全局token拦截和校验
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthenticationInterceptor implements HandlerInterceptor {
|
||||
|
||||
@Autowired
|
||||
UserDao userDao;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception {
|
||||
// 从 http 请求头中取出 token
|
||||
String token = httpServletRequest.getHeader("token");
|
||||
|
||||
// 如果不是映射到方法直接通过
|
||||
if(!(object instanceof HandlerMethod)){
|
||||
return true;
|
||||
}
|
||||
|
||||
HandlerMethod handlerMethod = (HandlerMethod)object;
|
||||
Method method = handlerMethod.getMethod();
|
||||
|
||||
//检查是否有passtoken注释,有则跳过认证
|
||||
if (method.isAnnotationPresent(PassToken.class)) {
|
||||
PassToken passToken = method.getAnnotation(PassToken.class);
|
||||
if (passToken.required()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//检查有没有需要用户权限的注解
|
||||
if (method.isAnnotationPresent(UserLoginToken.class)) {
|
||||
|
||||
UserLoginToken userLoginToken = method.getAnnotation(UserLoginToken.class);
|
||||
// 需要token认证
|
||||
if (userLoginToken.required()) {
|
||||
|
||||
// 如果请求头没有token
|
||||
if (token == null) {
|
||||
throw new RuntimeException("缺少token,请登录");
|
||||
}
|
||||
|
||||
// 获取 token 中的 user id
|
||||
String userId;
|
||||
|
||||
try {
|
||||
// 解密token,取出 用户id去查询数据
|
||||
userId = JWT.decode(token).getAudience().get(0);
|
||||
} catch (JWTDecodeException j) {
|
||||
throw new RuntimeException("无效token,请重新登录");
|
||||
}
|
||||
|
||||
UserModel user = userDao.getFindById(Integer.parseInt(userId));
|
||||
|
||||
log.info("user ======= {}", user.getUser_phone());
|
||||
if (user == null) {
|
||||
throw new RuntimeException("用户不存在,请重新登录");
|
||||
}
|
||||
|
||||
// 验证 token
|
||||
JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(Integer.toString(user.getUser_id()))).build();
|
||||
try {
|
||||
jwtVerifier.verify(token);
|
||||
} catch (JWTVerificationException e) {
|
||||
throw new RuntimeException("无效token,请重新登录");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.moehu.back.interceptor;
|
||||
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 全局异常处理
|
||||
*/
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionError {
|
||||
@ResponseBody
|
||||
@ExceptionHandler(Exception.class)
|
||||
public Map<String,Object> exceptionHandler (Exception ex) {
|
||||
Map<String,Object> result = new HashMap<String, Object>();
|
||||
result.put("code", 500);
|
||||
result.put("message",ex.getMessage());
|
||||
result.put("data", null);
|
||||
|
||||
System.out.println(ex.getMessage());
|
||||
if (ex.getMessage().contains("无效token")) {
|
||||
result.put("code", 403);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
6444069d-86fb-47a9-98d0-01a4e48581cb
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "收藏列表的Model")
|
||||
public class CollectionModel {
|
||||
|
||||
@ApiModelProperty(value = "作品的封面图")
|
||||
private String opus_img;
|
||||
|
||||
@ApiModelProperty(value = "作品详情的图片数组")
|
||||
private String[] opus_imgs;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "评论的Model")
|
||||
public class CommentModel {
|
||||
@ApiModelProperty(value = "评论的id")
|
||||
private int comment_id;
|
||||
|
||||
@ApiModelProperty(value = "作品表的作品id")
|
||||
private int opus_id;
|
||||
|
||||
@ApiModelProperty(value = "动态的id")
|
||||
private int dynamic_id;
|
||||
|
||||
@ApiModelProperty(value = "用户表的用户id")
|
||||
private int user_id;
|
||||
|
||||
@ApiModelProperty(value = "评论的内容")
|
||||
private String comment_content;
|
||||
|
||||
@ApiModelProperty(value = "评论的时间")
|
||||
private String comment_time;
|
||||
|
||||
@ApiModelProperty(value = "回复某个人的comment_id")
|
||||
private int comment_reply_id;
|
||||
|
||||
@ApiModelProperty(value = "被回复人的用户名")
|
||||
private String comment_to_username;
|
||||
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String user_nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String user_head_img;
|
||||
|
||||
@ApiModelProperty(value = "评论的类型:1 作品,2 动态")
|
||||
private int comment_type;
|
||||
|
||||
private List<CommentModel> child;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
|
||||
import com.moehu.back.model.response.UserInfoResponseModel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "动态的Model")
|
||||
public class DynamicModel {
|
||||
|
||||
@ApiModelProperty(value = "动态id")
|
||||
private int dynamic_id;
|
||||
|
||||
@ApiModelProperty(value = "作品id")
|
||||
private int opus_id;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private int user_id;
|
||||
|
||||
@ApiModelProperty(value = "动态的内容")
|
||||
private String dynamic_introduce;
|
||||
|
||||
@ApiModelProperty(value = "动态是否置顶,1置顶,0不置顶")
|
||||
private int dynamic_top;
|
||||
|
||||
@ApiModelProperty(value = "动态的发布时间")
|
||||
private String dynamic_time;
|
||||
|
||||
@ApiModelProperty(value = "动态分享的数量")
|
||||
private int dynamic_share_count;
|
||||
|
||||
@ApiModelProperty(value = "动态被评论的数量")
|
||||
private int dynamic_comment_count;
|
||||
|
||||
@ApiModelProperty(value = "动态点赞的数量")
|
||||
private int dynamic_satisfied_count;
|
||||
|
||||
@ApiModelProperty(value = "投稿动态:'投稿了新作',如果是普通动态为'' ")
|
||||
private String dynamic_text;
|
||||
|
||||
@ApiModelProperty(value = "动态的类型:1 投稿动态,2:普通动态")
|
||||
private int dynamic_type;
|
||||
|
||||
@ApiModelProperty(value = "动态的封面图")
|
||||
private String dynamic_img;
|
||||
|
||||
@ApiModelProperty(value = "用户信息")
|
||||
private UserInfoResponseModel user_info;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "作品图片的Model")
|
||||
public class ImgModel {
|
||||
@ApiModelProperty(value = "图片id")
|
||||
private int img_id;
|
||||
|
||||
@ApiModelProperty(value = "图片地址")
|
||||
private String img_url;
|
||||
|
||||
@ApiModelProperty(value = "图片宽度")
|
||||
private Integer img_width;
|
||||
|
||||
@ApiModelProperty(value = "图片高度")
|
||||
private Integer img_height;
|
||||
|
||||
@ApiModelProperty(value = "作品id")
|
||||
private int opus_id;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private int user_id;
|
||||
|
||||
@ApiModelProperty(value = "动态id")
|
||||
private int dynamic_id;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "作品的Model")
|
||||
public class OpusModel {
|
||||
@ApiModelProperty(value = "作品id")
|
||||
private int opus_id;
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private int user_id;
|
||||
@ApiModelProperty(value = "作品名称")
|
||||
private String opus_title;
|
||||
@ApiModelProperty(value = "作品介绍")
|
||||
private String opus_introduce;
|
||||
@ApiModelProperty(value = "作品发布时间")
|
||||
private String opus_time;
|
||||
@ApiModelProperty(value = "作品点赞数")
|
||||
private int opus_satisfied;
|
||||
@ApiModelProperty(value = "作品浏览量")
|
||||
private int opus_see;
|
||||
@ApiModelProperty(value = "作品的关注数量")
|
||||
private int opus_follow;
|
||||
|
||||
@ApiModelProperty(value = "作品的收藏数量")
|
||||
private int opus_collection;
|
||||
@ApiModelProperty(value = "作品的图片")
|
||||
private String opus_img;
|
||||
@ApiModelProperty(value = "作品的审核状态。等待审核0,审核驳回-1,审核通过1")
|
||||
private int opus_status;
|
||||
@ApiModelProperty(value = "作品的分类,推荐1,排行2,关注3")
|
||||
private int opus_type;
|
||||
|
||||
@ApiModelProperty(value = "作品是否原创 ,1原创,0 非原创")
|
||||
private int opus_original;
|
||||
|
||||
@ApiModelProperty(value = "作品公开范围,1所有人,2好友,3不公开")
|
||||
private int opus_jurisdiction;
|
||||
|
||||
@ApiModelProperty(value = "作品的标签是否可被编辑,1 开启编辑,0 没有开启编辑")
|
||||
private int opus_is_edit;
|
||||
|
||||
|
||||
// @ApiModelProperty(value = "点赞数的偏移量")
|
||||
// private float opus_satisfied_offset;
|
||||
// @ApiModelProperty(value = "作品浏览量的偏移量")
|
||||
// private float opus_see_offset;
|
||||
// @ApiModelProperty(value = "作品的关注数量的偏移量")
|
||||
// private float opus_follow_offset;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "分页的请求参数Model")
|
||||
public class PagingModel {
|
||||
@ApiModelProperty(value = "请求第几页")
|
||||
@Min(value = 1,message = "必须大于0")
|
||||
private Integer page;
|
||||
|
||||
@ApiModelProperty(value = "每页的页数")
|
||||
@Range(min = 10, max = 30,message = "一次性获取最大列表数不能超过30")
|
||||
private Integer count;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer userid;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "作品的Model")
|
||||
public class PushOpusModel {
|
||||
|
||||
@ApiModelProperty(value = "作品id")
|
||||
private int opus_id;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private int user_id;
|
||||
|
||||
@ApiModelProperty(value = "作品名称")
|
||||
private String opus_title;
|
||||
|
||||
@ApiModelProperty(value = "作品介绍")
|
||||
private String opus_introduce;
|
||||
|
||||
@ApiModelProperty(value = "作品的标签数组")
|
||||
private String[] opus_tags;
|
||||
|
||||
@ApiModelProperty(value = "作品的图片数组")
|
||||
private String[] opus_imgs;
|
||||
|
||||
@ApiModelProperty(value = "作品的主图")
|
||||
private String opus_img;
|
||||
|
||||
@ApiModelProperty(value = "作品公开范围,1所有人,2好友,3不公开")
|
||||
private int opus_jurisdiction;
|
||||
|
||||
@ApiModelProperty(value = "作品公开范围,1所有人,2好友,3不公开")
|
||||
private Boolean opus_syncDynamic;
|
||||
|
||||
@ApiModelProperty(value = "作品是否原创 ,1原创,0 非原创")
|
||||
private int opus_original;
|
||||
|
||||
@ApiModelProperty(value = "作品发布时间")
|
||||
private String opus_time;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.moehu.back.model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "接口公共返回字段")
|
||||
public class ResultModel<T> {
|
||||
@ApiModelProperty(value = "请求成功的状态码:200 成功,404 失败,500:系统错误")
|
||||
private int code;
|
||||
|
||||
@ApiModelProperty(value = "操作的描述信息")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "接口返回的数据")
|
||||
private T data;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "标签的Model")
|
||||
public class TagModel {
|
||||
@ApiModelProperty(value = "标签id")
|
||||
private int tags_id;
|
||||
|
||||
@ApiModelProperty(value = "作品id")
|
||||
private int opus_id;
|
||||
|
||||
@ApiModelProperty(value = "标签的内容")
|
||||
private String tags_title;
|
||||
|
||||
@ApiModelProperty(value = "该标签是否为推荐标签")
|
||||
private int tags_recommend;
|
||||
|
||||
@ApiModelProperty(value = "创建标签的用户id")
|
||||
private int user_id;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "App升级的model")
|
||||
public class UpdateModel {
|
||||
|
||||
@ApiModelProperty(value = "升级表id")
|
||||
private int update_id;
|
||||
|
||||
@ApiModelProperty(value = "app版本号")
|
||||
private String update_version;
|
||||
|
||||
@ApiModelProperty(value = "整数类型app版本号")
|
||||
private int update_version_code;
|
||||
|
||||
@ApiModelProperty(value = "app下载地址")
|
||||
private String update_down_url;
|
||||
|
||||
@ApiModelProperty(value = "app更新的内容")
|
||||
private String update_content;
|
||||
|
||||
@ApiModelProperty(value = "是否需要强制更新 1 需要,0不需要")
|
||||
private int update_force;
|
||||
|
||||
@ApiModelProperty(value = "app下载次数统计")
|
||||
private int update_down_count;
|
||||
|
||||
@ApiModelProperty(value = "app安装包大小,单位b")
|
||||
private int update_size;
|
||||
|
||||
@ApiModelProperty(value = "app发布版本时间")
|
||||
private String update_time;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.moehu.back.model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "用户信息的公共接口")
|
||||
public class UserModel {
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private int user_id;
|
||||
@ApiModelProperty(value = "用户的手机号")
|
||||
private String user_phone;
|
||||
|
||||
// @ApiModelProperty(value = "用户的密码")
|
||||
// private String user_pwd;
|
||||
@ApiModelProperty(value = "用户真实姓名")
|
||||
private String user_real_name;
|
||||
@ApiModelProperty(value = "用户身份证")
|
||||
private String user_id_card;
|
||||
@ApiModelProperty(value = "用户邮箱")
|
||||
private String user_email;
|
||||
@ApiModelProperty(value = "用户银行卡")
|
||||
private String user_bank_card;
|
||||
@ApiModelProperty(value = "用户性别")
|
||||
private String user_sex;
|
||||
@ApiModelProperty(value = "用户的职业")
|
||||
private String user_work;
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String user_head_img;
|
||||
@ApiModelProperty(value = "用户默认昵称")
|
||||
private String user_nickname;
|
||||
@ApiModelProperty(value = "用户申请账号的固定ID,不可修改")
|
||||
private String user_uid;
|
||||
@ApiModelProperty(value = "用户注册的时间")
|
||||
private String user_reg_time;
|
||||
// @ApiModelProperty(value = "用户最后一次登录ip")
|
||||
// private String user_ip;
|
||||
@ApiModelProperty(value = "用户出生日期")
|
||||
private String user_birthday;
|
||||
@ApiModelProperty(value = "用户的星座")
|
||||
private String user_constellation;
|
||||
@ApiModelProperty(value = "用户签名")
|
||||
private String user_autograph;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.moehu.back.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Service
|
||||
@ApiModel(value = "用户昵称,头像,签名的Model")
|
||||
public class UserVerify {
|
||||
|
||||
@ApiModelProperty(value = "用户信息核查表的id")
|
||||
private int user_verify_id;
|
||||
|
||||
@ApiModelProperty(value = "用户提交修改的时间")
|
||||
private String user_verify_time;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private int user_id;
|
||||
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String user_head_img;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
private String user_nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户的个性签名")
|
||||
private String user_autograph;
|
||||
|
||||
@ApiModelProperty(value = "审核状态: 0等待审核,1 审核通过, -1 审核拒绝")
|
||||
private int user_verify_status;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
3c59c82f-6baa-4730-b5ef-dc8f832bd37c
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.moehu.back.model.expand;
|
||||
import com.moehu.back.model.DynamicModel;
|
||||
import com.moehu.back.model.ImgModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DynamiciImgModel extends DynamicModel {
|
||||
|
||||
@ApiModelProperty(value = "动态的图片数组")
|
||||
private List<ImgModel> dynamic_imgs;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
2bde966e-2acb-4af0-8671-2bb2f5900291
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.moehu.back.model.request;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class CreatedOpusInfoTagModel {
|
||||
|
||||
@ApiModelProperty(value = "标签的标题")
|
||||
private String tags_title;
|
||||
|
||||
@ApiModelProperty(value = "作品id")
|
||||
private int opus_id;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private int user_id;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.moehu.back.model.request;
|
||||
|
||||
import com.moehu.back.model.DynamicModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DynamicPushModel extends DynamicModel {
|
||||
|
||||
@ApiModelProperty(value = "动态的图片数组")
|
||||
private String[] dynamic_imgs;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.moehu.back.model.request;
|
||||
|
||||
import com.moehu.back.model.PagingModel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Service
|
||||
@ApiModel(value = "请求参数Model")
|
||||
public class UpdateListRequest extends PagingModel {
|
||||
|
||||
@ApiModelProperty(value = "app版本号")
|
||||
private String update_version;
|
||||
|
||||
@ApiModelProperty(value = "app版本id")
|
||||
private Integer update_id;
|
||||
|
||||
@ApiModelProperty(value = "是否需要强制更新 1 需要,0不需要")
|
||||
private String update_force;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.moehu.back.model.request;
|
||||
|
||||
import com.moehu.back.model.DynamicModel;
|
||||
import com.moehu.back.model.PagingModel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Service
|
||||
@ApiModel(value = "用户昵称,头像,签名的Model")
|
||||
public class UserVerifyRequest extends PagingModel {
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
private String user_id;
|
||||
|
||||
@ApiModelProperty(value = "需要请求的数据类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "审核状态: 0等待审核,1 审核通过, -1 审核拒绝")
|
||||
private String user_verify_status;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
630d97b2-2a2b-4f72-8bf4-bdbba26463e5
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.moehu.back.model.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "登录注册响应的Model")
|
||||
public class LoginResponseModel<T> {
|
||||
@ApiModelProperty(value = "用户Token")
|
||||
private String user_token;
|
||||
@ApiModelProperty(value = "用户信息")
|
||||
private T user_info;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.moehu.back.model.response;
|
||||
|
||||
import com.moehu.back.model.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "作品详情的Model")
|
||||
public class OpusInfoResponseModel extends OpusModel {
|
||||
|
||||
// @ApiModelProperty(value = "作品的评论,如果没有显示null")
|
||||
// private List<CommentModel> comment;
|
||||
|
||||
@ApiModelProperty(value = "作者的往期最新作品,只返回10条,更多的需要去个人空间查看,如果没有显示null")
|
||||
private List<OpusModel> news_opus;
|
||||
|
||||
@ApiModelProperty(value = "发布该作品的用户信息")
|
||||
private UserModel user_info;
|
||||
|
||||
@ApiModelProperty(value = "作品的所有图片合集")
|
||||
private List<ImgModel> opus_imgs;
|
||||
|
||||
@ApiModelProperty(value = "作品相关的tag标签")
|
||||
private List<TagModel> tags;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.moehu.back.model.response;
|
||||
|
||||
import com.moehu.back.model.OpusModel;
|
||||
import com.moehu.back.model.UserModel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Service
|
||||
@ApiModel(value = "搜索用户返回的Model")
|
||||
public class OpusSearchUser extends UserModel {
|
||||
@ApiModelProperty(value = "当前搜索出来的用户是否被关注了,true关注了,false没关注")
|
||||
private boolean have_follow;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.moehu.back.model.response;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "分页响应的Model")
|
||||
public class PagingResponseModel<T> {
|
||||
@ApiModelProperty(value = "总页数")
|
||||
private int total_page;
|
||||
@ApiModelProperty(value = "下一页")
|
||||
private int next_page;
|
||||
@ApiModelProperty(value = "当前页")
|
||||
private int current_page;
|
||||
@ApiModelProperty(value = "获取的数据")
|
||||
private T result;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user