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 1a001d0b
authored
Mar 18, 2021
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
车家智能V1.0.0开发 用户数据--think.wang
1 parent
47f21cec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
15 deletions
src/main/java/com/glsx/smart/controller/SceneTemplateController.java
src/main/java/com/glsx/smart/controller/UserRelationController.java
src/main/java/com/glsx/smart/service/SmartUserRelationService.java
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
src/main/java/com/glsx/smart/controller/SceneTemplateController.java
View file @
1a001d0
...
@@ -7,10 +7,7 @@ import com.glsx.smart.service.SmartSceneTemplateService;
...
@@ -7,10 +7,7 @@ import com.glsx.smart.service.SmartSceneTemplateService;
import
com.glsx.smart.service.SmartTemplateParamService
;
import
com.glsx.smart.service.SmartTemplateParamService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
...
@@ -47,7 +44,7 @@ public class SceneTemplateController {
...
@@ -47,7 +44,7 @@ public class SceneTemplateController {
}
}
@RequestMapping
(
value
=
"/getById"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getById"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
SmartSceneTemplate
getById
(
Long
id
)
{
public
SmartSceneTemplate
getById
(
@RequestParam
(
"id"
)
Long
id
)
{
log
.
info
(
"/sceneTemplate/getById param: {}"
,
id
);
log
.
info
(
"/sceneTemplate/getById param: {}"
,
id
);
SmartSceneTemplate
template
=
sceneTemplateService
.
getById
(
id
);
SmartSceneTemplate
template
=
sceneTemplateService
.
getById
(
id
);
if
(
template
!=
null
){
if
(
template
!=
null
){
...
...
src/main/java/com/glsx/smart/controller/UserRelationController.java
View file @
1a001d0
...
@@ -5,10 +5,7 @@ import com.glsx.smart.dao.entity.SmartUserRelation;
...
@@ -5,10 +5,7 @@ import com.glsx.smart.dao.entity.SmartUserRelation;
import
com.glsx.smart.service.SmartUserRelationService
;
import
com.glsx.smart.service.SmartUserRelationService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* @Title: UserRelationController.java
* @Title: UserRelationController.java
...
@@ -28,15 +25,22 @@ public class UserRelationController {
...
@@ -28,15 +25,22 @@ public class UserRelationController {
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/getSingle"
,
method
=
{
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getSingle"
,
method
=
{
RequestMethod
.
POST
})
public
SmartUserRelation
getSingle
(
SmartUserRelation
userRelation
){
public
SmartUserRelation
getSingle
(
@RequestBody
SmartUserRelation
userRelation
){
return
userRelationService
.
getSingle
(
userRelation
);
return
userRelationService
.
getSingle
(
userRelation
);
}
}
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/add"
,
method
=
{
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/add"
,
method
=
{
RequestMethod
.
POST
})
public
boolean
add
(
SmartUserRelation
userRelation
){
public
Long
add
(
@RequestBody
SmartUserRelation
userRelation
){
log
.
info
(
"/user/add保存数据参数:{}"
,
JSON
.
toJSONString
(
userRelation
));
log
.
info
(
"/user/add保存数据参数:{}"
,
JSON
.
toJSONString
(
userRelation
));
return
userRelationService
.
insertSelective
(
userRelation
)
>
0
?
true
:
false
;
return
userRelationService
.
insertSelective
(
userRelation
);
}
}
@ResponseBody
@RequestMapping
(
value
=
"/update"
,
method
=
{
RequestMethod
.
POST
})
public
Integer
update
(
@RequestBody
SmartUserRelation
userRelation
){
log
.
info
(
"/user/update保存数据参数:{}"
,
JSON
.
toJSONString
(
userRelation
));
return
userRelationService
.
updateByPrimaryKeySelective
(
userRelation
);
}
}
}
src/main/java/com/glsx/smart/service/SmartUserRelationService.java
View file @
1a001d0
...
@@ -17,7 +17,7 @@ public interface SmartUserRelationService {
...
@@ -17,7 +17,7 @@ public interface SmartUserRelationService {
int
insertOrUpdate
(
SmartUserRelation
record
);
int
insertOrUpdate
(
SmartUserRelation
record
);
int
insertSelective
(
SmartUserRelation
record
);
Long
insertSelective
(
SmartUserRelation
record
);
SmartUserRelation
getSingle
(
SmartUserRelation
record
);
SmartUserRelation
getSingle
(
SmartUserRelation
record
);
...
...
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
View file @
1a001d0
...
@@ -45,8 +45,9 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
...
@@ -45,8 +45,9 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
}
}
@Override
@Override
public
int
insertSelective
(
SmartUserRelation
record
)
{
public
Long
insertSelective
(
SmartUserRelation
record
)
{
return
smartUserRelationMapper
.
insertSelective
(
record
);
int
i
=
smartUserRelationMapper
.
insertSelective
(
record
);
return
i
>
0
?
record
.
getId
()
:
0L
;
}
}
@Override
@Override
...
...
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