Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
c7aef37f
提交
c7aef37f
authored
12月 05, 2020
作者:
Whispa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit commit
上级
d4a2384d
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
241 行增加
和
2 行删除
+241
-2
AuthController.java
...a/com/example/afrishop_v3/controllers/AuthController.java
+2
-2
TbCfGoodstwotype.java
...java/com/example/afrishop_v3/models/TbCfGoodstwotype.java
+19
-0
TbCfSolve.java
src/main/java/com/example/afrishop_v3/models/TbCfSolve.java
+117
-0
TbCfSolveRepository.java
...m/example/afrishop_v3/repository/TbCfSolveRepository.java
+7
-0
BannerController.java
...example/afrishop_v3/web/controllers/BannerController.java
+28
-0
ColumnController.java
...example/afrishop_v3/web/controllers/ColumnController.java
+41
-0
SolveController.java
.../example/afrishop_v3/web/controllers/SolveController.java
+27
-0
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/AuthController.java
浏览文件 @
c7aef37f
...
@@ -98,7 +98,7 @@ public class AuthController extends Controller {
...
@@ -98,7 +98,7 @@ public class AuthController extends Controller {
TbCfUserInfo
userInfo
=
byAccount
.
get
();
TbCfUserInfo
userInfo
=
byAccount
.
get
();
fixCode
(
userInfo
);
fixCode
(
userInfo
);
Authentication
authentication
;
Authentication
authentication
;
try
{
try
{
authentication
=
authenticationManager
.
authenticate
(
authentication
=
authenticationManager
.
authenticate
(
...
@@ -263,7 +263,7 @@ public class AuthController extends Controller {
...
@@ -263,7 +263,7 @@ public class AuthController extends Controller {
if
(
phone
.
isEmpty
())
{
if
(
phone
.
isEmpty
())
{
return
new
Result
<>(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
(),
"
Email
is empty"
);
return
new
Result
<>(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
(),
"
Phone
is empty"
);
}
}
if
(!
isPhoneValid
(
phone
))
{
if
(!
isPhoneValid
(
phone
))
{
...
...
src/main/java/com/example/afrishop_v3/models/TbCfGoodstwotype.java
浏览文件 @
c7aef37f
...
@@ -5,7 +5,11 @@ import lombok.Setter;
...
@@ -5,7 +5,11 @@ import lombok.Setter;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Transient
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* 商品二级分类表实体
* 商品二级分类表实体
...
@@ -37,6 +41,13 @@ public class TbCfGoodstwotype{
...
@@ -37,6 +41,13 @@ public class TbCfGoodstwotype{
*/
*/
private
String
goodstwotypeUrl
;
private
String
goodstwotypeUrl
;
@Transient
private
boolean
autoLoad
=
false
;
@OneToMany
(
mappedBy
=
"goodstwotypeId"
)
private
List
<
TbCfDescripiton
>
categoryList
=
new
ArrayList
<>();
/**
/**
* 设置:商品二级分类Id
* 设置:商品二级分类Id
*/
*/
...
@@ -50,6 +61,10 @@ public class TbCfGoodstwotype{
...
@@ -50,6 +61,10 @@ public class TbCfGoodstwotype{
public
String
getGoodstwotypeId
()
{
public
String
getGoodstwotypeId
()
{
return
goodstwotypeId
;
return
goodstwotypeId
;
}
}
public
void
enableAutoLoad
(){
this
.
autoLoad
=
true
;
}
/**
/**
* 设置:商品二级分类标题
* 设置:商品二级分类标题
*/
*/
...
@@ -57,6 +72,10 @@ public class TbCfGoodstwotype{
...
@@ -57,6 +72,10 @@ public class TbCfGoodstwotype{
this
.
goodstwotypeTitle
=
goodstwotypeTitle
;
this
.
goodstwotypeTitle
=
goodstwotypeTitle
;
}
}
public
List
<
TbCfDescripiton
>
getCategoryList
()
{
return
autoLoad
?
categoryList
:
new
ArrayList
<>();
}
/**
/**
* 获取:商品二级分类标题
* 获取:商品二级分类标题
*/
*/
...
...
src/main/java/com/example/afrishop_v3/models/TbCfSolve.java
0 → 100644
浏览文件 @
c7aef37f
package
com
.
example
.
afrishop_v3
.
models
;
import
lombok.Data
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
java.util.Date
;
@Entity
@Data
public
class
TbCfSolve
{
/**
* ID
*/
@Id
private
String
id
;
/**
* 类型 1:about us 2:contact us 3:faq
*/
private
Integer
type
;
/**
* 用户ID
*/
private
String
userId
;
/**
* 是否有帮助 1:yes 2:no
*/
private
Integer
isSolve
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:类型 1:about us 2:contact us 3:faq
*/
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
/**
* 获取:类型 1:about us 2:contact us 3:faq
*/
public
Integer
getType
()
{
return
type
;
}
/**
* 设置:用户ID
*/
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
/**
* 获取:用户ID
*/
public
String
getUserId
()
{
return
userId
;
}
/**
* 设置:是否有帮助 1:yes 2:no
*/
public
void
setIsSolve
(
Integer
isSolve
)
{
this
.
isSolve
=
isSolve
;
}
/**
* 获取:是否有帮助 1:yes 2:no
*/
public
Integer
getIsSolve
()
{
return
isSolve
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
src/main/java/com/example/afrishop_v3/repository/TbCfSolveRepository.java
0 → 100644
浏览文件 @
c7aef37f
package
com
.
example
.
afrishop_v3
.
repository
;
import
com.example.afrishop_v3.models.TbCfSolve
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
TbCfSolveRepository
extends
PagingAndSortingRepository
<
TbCfSolve
,
String
>
{
}
src/main/java/com/example/afrishop_v3/web/controllers/BannerController.java
0 → 100644
浏览文件 @
c7aef37f
package
com
.
example
.
afrishop_v3
.
web
.
controllers
;
import
com.example.afrishop_v3.base.Result
;
import
com.example.afrishop_v3.models.TbCfHomePage
;
import
com.example.afrishop_v3.repository.TbCfHomePageRepository
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/website/banner"
)
public
class
BannerController
{
private
final
TbCfHomePageRepository
repository
;
public
BannerController
(
TbCfHomePageRepository
repository
)
{
this
.
repository
=
repository
;
}
@GetMapping
public
Result
getBannerList
(
@RequestParam
(
value
=
"version"
)
Integer
version
)
{
List
<
TbCfHomePage
>
list
=
repository
.
getAllByImgVersionAndEnableFlag
(
version
,
1
);
return
new
Result
<>(
list
);
}
}
src/main/java/com/example/afrishop_v3/web/controllers/ColumnController.java
0 → 100644
浏览文件 @
c7aef37f
package
com
.
example
.
afrishop_v3
.
web
.
controllers
;
import
com.example.afrishop_v3.base.Result
;
import
com.example.afrishop_v3.models.TbCfGoodstwotype
;
import
com.example.afrishop_v3.models.TbCfGoodstype
;
import
com.example.afrishop_v3.repository.TbCfGoodstwotypeRepository
;
import
com.example.afrishop_v3.repository.TbCfGoodstypeRepository
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/website/column2"
)
public
class
ColumnController
{
private
final
TbCfGoodstypeRepository
repository
;
private
final
TbCfGoodstwotypeRepository
goodstwotypeRepository
;
public
ColumnController
(
TbCfGoodstypeRepository
repository
,
TbCfGoodstwotypeRepository
goodstwotypeRepository
)
{
this
.
repository
=
repository
;
this
.
goodstwotypeRepository
=
goodstwotypeRepository
;
}
@GetMapping
public
Result
getAllColumn
()
{
Iterable
<
TbCfGoodstype
>
all
=
repository
.
findAll
();
return
new
Result
<>(
all
);
}
@GetMapping
(
"/{id}"
)
public
Result
getColumnChildren
(
@PathVariable
String
id
)
{
List
<
TbCfGoodstwotype
>
list
=
goodstwotypeRepository
.
findAllByGoodstypeId
(
id
);
list
.
forEach
(
TbCfGoodstwotype:
:
enableAutoLoad
);
return
new
Result
<>(
list
);
}
}
src/main/java/com/example/afrishop_v3/web/controllers/SolveController.java
0 → 100644
浏览文件 @
c7aef37f
package
com
.
example
.
afrishop_v3
.
web
.
controllers
;
import
com.example.afrishop_v3.base.Result
;
import
com.example.afrishop_v3.models.TbCfSolve
;
import
com.example.afrishop_v3.repository.TbCfSolveRepository
;
import
com.example.afrishop_v3.util.IdUtil
;
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
;
@RestController
@RequestMapping
(
"/website/solve"
)
public
class
SolveController
{
private
final
TbCfSolveRepository
repository
;
public
SolveController
(
TbCfSolveRepository
repository
)
{
this
.
repository
=
repository
;
}
@PostMapping
(
"/save"
)
public
Result
save
(
@RequestBody
TbCfSolve
tbCfSolve
)
{
tbCfSolve
.
setId
(
IdUtil
.
createIdbyUUID
());
TbCfSolve
cfSolve
=
repository
.
save
(
tbCfSolve
);
return
new
Result
<>(
cfSolve
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论