Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 93185c90
authored
Mar 25, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改:产品类型列表获取
1 parent
a9fa8dea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
src/main/java/com/glsx/smart/dao/entity/SmartProductType.java
src/main/java/com/glsx/smart/filter/CorsFilter.java
src/main/resources/mapper/SmartProductTypeMapper.xml
src/main/java/com/glsx/smart/dao/entity/SmartProductType.java
View file @
93185c9
...
...
@@ -26,6 +26,12 @@ import lombok.Data;
@Table
(
name
=
"smart_product_type"
)
public
class
SmartProductType
extends
BaseDTO
{
/**
* 一级分类
*/
@Transient
private
String
firstCategory
;
/**
* 内容列表
*/
@Transient
...
...
src/main/java/com/glsx/smart/filter/CorsFilter.java
View file @
93185c9
...
...
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.IOException
;
import
java.util.Enumeration
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.stereotype.Component
;
/**
...
...
@@ -47,7 +48,7 @@ public class CorsFilter implements Filter {
httpResponse
.
addHeader
(
HttpHeaders
.
ACCESS_CONTROL_MAX_AGE
,
"18000L"
);
// 放行预检请求(preflight requests)
if
(
httpRequest
.
getMethod
().
equalsIgnoreCase
(
"OPTIONS"
))
{
if
(
httpRequest
.
getMethod
().
equalsIgnoreCase
(
HttpMethod
.
OPTIONS
.
toString
()
))
{
httpResponse
.
setStatus
(
HttpServletResponse
.
SC_OK
);
httpResponse
.
getWriter
().
println
(
"OK"
);
return
;
...
...
src/main/resources/mapper/SmartProductTypeMapper.xml
View file @
93185c9
...
...
@@ -33,8 +33,10 @@
<select
id=
"getList"
resultMap=
"BaseResultMap"
>
select spt.id, spt.type_name, spt.category_key, spt.shop_tag, spt.remark, spt.create_time,
spt.create_by, spt.update_time, spt.update_by
spt.create_by, spt.update_time, spt.update_by,
ssc.parent_key firstCategory
from smart_product_type spt
left join smart_sys_code ssc on ssc.dict_key = spt.category_key
<where>
<if
test=
"typeName != null and typeName != ''"
>
and spt.type_name like concat('%', #{typeName,jdbcType=VARCHAR}, '%')
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment