Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
caoyan
6 years ago
Commit
9bed0b6bbbd2760a076f5d4fc19d3589905086eb
1 parent
699bd1ba
二手
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
215 additions
and
3 deletions
dal/src/main/java/com/yohoufo/dal/product/SecondhandImagesMapper.java
dal/src/main/java/com/yohoufo/dal/product/SecondhandInfoMapper.java
dal/src/main/java/com/yohoufo/dal/product/model/SecondhandImages.java
dal/src/main/java/com/yohoufo/dal/product/model/SecondhandInfo.java
dal/src/main/resources/META-INF/mybatis/product/SecondhandImagesMapper.xml
dal/src/main/resources/META-INF/mybatis/product/SecondhandInfoMapper.xml
product/src/main/java/com/yohoufo/product/controller/SecondhandProductController.java
product/src/main/java/com/yohoufo/product/service/SecondhandProductService.java
product/src/main/java/com/yohoufo/product/service/impl/SecondhandProductServiceImpl.java
web/src/main/resources/databases.yml
web/src/main/webapp/META-INF/autoconf/databases.yml
dal/src/main/java/com/yohoufo/dal/product/SecondhandImagesMapper.java
0 → 100644
View file @
9bed0b6
package
com
.
yohoufo
.
dal
.
product
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.yohoufo.dal.product.model.SecondhandImages
;
public
interface
SecondhandImagesMapper
{
int
insertBatch
(
@Param
(
"records"
)
List
<
SecondhandImages
>
record
);
List
<
SecondhandImages
>
selectBySkup
(
Integer
skup
);
}
\ No newline at end of file
...
...
dal/src/main/java/com/yohoufo/dal/product/SecondhandInfoMapper.java
0 → 100644
View file @
9bed0b6
package
com
.
yohoufo
.
dal
.
product
;
import
org.apache.ibatis.annotations.Param
;
import
com.yohoufo.dal.product.model.SecondhandInfo
;
public
interface
SecondhandInfoMapper
{
int
insert
(
@Param
(
"record"
)
SecondhandInfo
record
);
}
\ No newline at end of file
...
...
dal/src/main/java/com/yohoufo/dal/product/model/SecondhandImages.java
0 → 100644
View file @
9bed0b6
package
com
.
yohoufo
.
dal
.
product
.
model
;
public
class
SecondhandImages
{
private
Integer
id
;
private
Integer
skup
;
private
Integer
type
;
private
String
isDefault
;
private
String
imageUrl
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getSkup
()
{
return
skup
;
}
public
void
setSkup
(
Integer
skup
)
{
this
.
skup
=
skup
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
String
getIsDefault
()
{
return
isDefault
;
}
public
void
setIsDefault
(
String
isDefault
)
{
this
.
isDefault
=
isDefault
;
}
public
String
getImageUrl
()
{
return
imageUrl
;
}
public
void
setImageUrl
(
String
imageUrl
)
{
this
.
imageUrl
=
imageUrl
;
}
}
\ No newline at end of file
...
...
dal/src/main/java/com/yohoufo/dal/product/model/SecondhandInfo.java
0 → 100644
View file @
9bed0b6
package
com
.
yohoufo
.
dal
.
product
.
model
;
public
class
SecondhandInfo
{
private
Integer
id
;
private
Integer
skup
;
private
String
flawId
;
private
String
flawAttr
;
private
String
describeInfo
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getSkup
()
{
return
skup
;
}
public
void
setSkup
(
Integer
skup
)
{
this
.
skup
=
skup
;
}
public
String
getFlawId
()
{
return
flawId
;
}
public
void
setFlawId
(
String
flawId
)
{
this
.
flawId
=
flawId
;
}
public
String
getFlawAttr
()
{
return
flawAttr
;
}
public
void
setFlawAttr
(
String
flawAttr
)
{
this
.
flawAttr
=
flawAttr
;
}
public
String
getDescribeInfo
()
{
return
describeInfo
;
}
public
void
setDescribeInfo
(
String
describeInfo
)
{
this
.
describeInfo
=
describeInfo
;
}
}
\ No newline at end of file
...
...
dal/src/main/resources/META-INF/mybatis/product/SecondhandImagesMapper.xml
0 → 100644
View file @
9bed0b6
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yohoufo.dal.product.SecondhandImagesMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yohoufo.dal.product.model.SecondhandImages"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"skup"
jdbcType=
"INTEGER"
property=
"skup"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"is_default"
jdbcType=
"CHAR"
property=
"isDefault"
/>
<result
column=
"image_url"
jdbcType=
"VARCHAR"
property=
"imageUrl"
/>
</resultMap>
<insert
id=
"insertBatch"
>
insert into secondhand_images (skup, type, is_default, image_url)
values
<foreach
collection=
"records"
item=
"item"
separator=
","
>
(#{item.skup,jdbcType=INTEGER}, #{item.type,jdbcType=INTEGER},
#{item.isDefault,jdbcType=CHAR}, #{item.imageUrl,jdbcType=VARCHAR})
</foreach>
</insert>
<select
id=
"selectBySkup"
resultMap=
"BaseResultMap"
>
select id, skup, type, is_default, image_url
from secondhand_images where skup = #{skup,jdbcType=INTEGER};
</select>
</mapper>
\ No newline at end of file
...
...
dal/src/main/resources/META-INF/mybatis/product/SecondhandInfoMapper.xml
0 → 100644
View file @
9bed0b6
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yohoufo.dal.product.SecondhandInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yohoufo.dal.product.model.SecondhandInfo"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"skup"
property=
"skup"
jdbcType=
"INTEGER"
/>
<result
column=
"flaw_id"
property=
"flawId"
jdbcType=
"VARCHAR"
/>
<result
column=
"flaw_attr"
property=
"flawAttr"
jdbcType=
"VARCHAR"
/>
<result
column=
"describe_info"
property=
"describe_info"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, skup, flaw_id, flaw_attr, describe_info, create_time
</sql>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"record.id"
>
insert into secondhand_info (skup, flaw_id, flaw_attr, describe_info, create_time)
values (#{record.skup,jdbcType=INTEGER}, #{record.flawId,jdbcType=VARCHAR},
#{record.flawAttr,jdbcType=VARCHAR}, #{record.describeInfo,jdbcType=VARCHAR}, unix_timestamp())
</insert>
</mapper>
\ No newline at end of file
...
...
product/src/main/java/com/yohoufo/product/controller/SecondhandProductController.java
View file @
9bed0b6
...
...
@@ -38,5 +38,4 @@ public class SecondhandProductController {
List
<
SecondhandFlaw
>
list
=
secondhandProductService
.
queryFlawListByType
(
type
);
return
new
ApiResponse
.
ApiResponseBuilder
().
data
(
list
).
code
(
200
).
message
(
"secondhandFlaw list."
).
build
();
}
}
\ No newline at end of file
...
...
product/src/main/java/com/yohoufo/product/service/SecondhandProductService.java
View file @
9bed0b6
...
...
@@ -3,8 +3,11 @@ package com.yohoufo.product.service;
import
java.util.List
;
import
com.yohoufo.dal.product.model.SecondhandFlaw
;
import
com.yohoufo.dal.product.model.SecondhandImages
;
public
interface
SecondhandProductService
{
List
<
SecondhandFlaw
>
queryFlawListByType
(
Integer
type
);
int
saveSkupInfo
(
Integer
skup
,
String
flawId
,
String
flawAttr
,
String
describeInfo
,
List
<
SecondhandImages
>
list
);
}
...
...
product/src/main/java/com/yohoufo/product/service/impl/SecondhandProductServiceImpl.java
View file @
9bed0b6
...
...
@@ -8,7 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
com.yohoufo.dal.product.SecondhandFlawMapper
;
import
com.yohoufo.dal.product.SecondhandImagesMapper
;
import
com.yohoufo.dal.product.SecondhandInfoMapper
;
import
com.yohoufo.dal.product.model.SecondhandFlaw
;
import
com.yohoufo.dal.product.model.SecondhandImages
;
import
com.yohoufo.dal.product.model.SecondhandInfo
;
import
com.yohoufo.product.service.SecondhandProductService
;
...
...
@@ -19,11 +23,33 @@ public class SecondhandProductServiceImpl implements SecondhandProductService {
@Autowired
private
SecondhandFlawMapper
secondhandFlawMapper
;
@Autowired
private
SecondhandImagesMapper
secondhandImagesMapper
;
@Autowired
private
SecondhandInfoMapper
secondhandInfoMapper
;
@Override
public
List
<
SecondhandFlaw
>
queryFlawListByType
(
Integer
type
)
{
return
secondhandFlawMapper
.
selectByType
(
type
);
}
@Override
public
int
saveSkupInfo
(
Integer
skup
,
String
flawId
,
String
flawAttr
,
String
describeInfo
,
List
<
SecondhandImages
>
list
)
{
//保存图片
int
num
=
secondhandImagesMapper
.
insertBatch
(
list
);
if
(
num
==
0
)
{
return
num
;
}
SecondhandInfo
record
=
new
SecondhandInfo
();
record
.
setSkup
(
skup
);
record
.
setFlawId
(
flawId
);
record
.
setFlawAttr
(
flawAttr
);
record
.
setDescribeInfo
(
describeInfo
);
return
secondhandInfoMapper
.
insert
(
record
);
}
}
...
...
web/src/main/resources/databases.yml
View file @
9bed0b6
...
...
@@ -43,6 +43,8 @@ datasources:
-
com.yohoufo.dal.product.ProductSelfShelvesMapper
-
com.yohoufo.dal.product.ProductSelfShelvesPicMapper
-
com.yohoufo.dal.product.SecondhandFlawMapper
-
com.yohoufo.dal.product.SecondhandImagesMapper
-
com.yohoufo.dal.product.SecondhandInfoMapper
ufo_order
:
...
...
web/src/main/webapp/META-INF/autoconf/databases.yml
View file @
9bed0b6
...
...
@@ -43,6 +43,8 @@ datasources:
-
com.yohoufo.dal.product.ProductSelfShelvesMapper
-
com.yohoufo.dal.product.ProductSelfShelvesPicMapper
-
com.yohoufo.dal.product.SecondhandFlawMapper
-
com.yohoufo.dal.product.SecondhandImagesMapper
-
com.yohoufo.dal.product.SecondhandInfoMapper
ufo_order
:
servers
:
...
...
Please
register
or
login
to post a comment