Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-api
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 46b706e2
authored
Mar 22, 2021
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
车家智能移动端服务 场景相关接口--think.wang
1 parent
604e614b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
315 additions
and
0 deletions
src/main/java/com/glsx/api/controller/OrderValueController.java
src/main/java/com/glsx/api/controller/ProductController.java
src/main/java/com/glsx/api/pojo/request/DeviceOrderValueReq.java
src/main/java/com/glsx/api/pojo/request/ProductReq.java
src/main/java/com/glsx/api/pojo/response/DeviceOrderValueResp.java
src/main/java/com/glsx/api/pojo/response/ProductResp.java
src/main/java/com/glsx/api/remote/OrderValueFeignClient.java
src/main/java/com/glsx/api/remote/ProductFeignClient.java
src/main/java/com/glsx/api/controller/OrderValueController.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.glsx.api.pojo.request.DeviceOrderValueReq
;
import
com.glsx.api.remote.OrderValueFeignClient
;
import
com.glsx.plat.core.web.R
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @Title: OrderValueController.java
* @Description: 场景设备指令集值列表
* @author think.wang
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Slf4j
@RestController
@RequestMapping
(
"/orderValue"
)
public
class
OrderValueController
extends
BaseController
{
@Autowired
private
OrderValueFeignClient
valueFeignClient
;
@ResponseBody
@RequestMapping
(
"/getList"
)
public
R
getList
(
DeviceOrderValueReq
req
){
log
.
info
(
"根据条件参数获取指令值列表:{}"
,
JSON
.
toJSONString
(
req
));
return
R
.
ok
().
data
(
valueFeignClient
.
getList
(
req
));
}
}
src/main/java/com/glsx/api/controller/ProductController.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.glsx.api.constant.Constant
;
import
com.glsx.api.pojo.request.ProductReq
;
import
com.glsx.api.remote.ProductFeignClient
;
import
com.glsx.plat.core.web.R
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-17
*/
@Slf4j
@RestController
@RequestMapping
(
"/product"
)
public
class
ProductController
{
@Autowired
private
ProductFeignClient
productFeignClient
;
/**
* 获取结构化的产品类型
*
* @return 结果
*/
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
POST
})
public
R
getTypeAndCategory
(
@RequestBody
ProductReq
req
)
{
req
.
setStatus
(
Constant
.
ONLINE
);
log
.
info
(
"根据条件参数获取产品列表:{}"
,
JSON
.
toJSONString
(
req
));
return
R
.
ok
().
data
(
productFeignClient
.
getListByCondition
(
req
));
}
}
src/main/java/com/glsx/api/pojo/request/DeviceOrderValueReq.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
pojo
.
request
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.groups.Default
;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-19
*/
/**
* 车家智能场景设备指令集表
*/
@Data
public
class
DeviceOrderValueReq
{
private
Integer
id
;
/**
* 关联smart_device_order表中id
*/
private
Integer
orderId
;
private
String
deviceStatusCode
;
private
String
deviceStatusValue
;
}
src/main/java/com/glsx/api/pojo/request/ProductReq.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
pojo
.
request
;
import
lombok.Data
;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-15
*/
/**
* 车家智能产品数据表
*/
@Data
public
class
ProductReq
{
/**
* 标识ID
*/
private
Long
id
;
/**
* 产品名称
*/
private
String
productName
;
/**
* 图片ID 关联smart_sys_file中id
*/
private
Long
icon
;
/**
* 产品类型ID 关联smart_product_type中id
*/
private
Long
typeId
;
/**
* 商城产品id
*/
private
String
shopProductId
;
/**
* 接入平台key 关联smart_sys_code中dict_key
*/
private
String
platformKey
;
/**
* 接入平台产品id
*/
private
String
platformProductId
;
/**
* 配网方式key 关联smart_sys_code中dict_key
*/
private
String
networkKey
;
/**
* 状态:0下线 1上线
*/
private
Byte
status
;
}
src/main/java/com/glsx/api/pojo/response/DeviceOrderValueResp.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
pojo
.
response
;
import
lombok.Data
;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-19
*/
/**
* 车家智能场景设备指令集表
*/
@Data
public
class
DeviceOrderValueResp
{
private
Integer
id
;
/**
* 关联smart_device_order表中id
*/
private
Integer
orderId
;
private
String
deviceStatusCode
;
private
String
deviceStatusValue
;
}
src/main/java/com/glsx/api/pojo/response/ProductResp.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
pojo
.
response
;
import
lombok.Data
;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-15
*/
/**
* 车家智能产品数据表
*/
@Data
public
class
ProductResp
{
/**
* 标识ID
*/
private
Long
id
;
/**
* 产品名称
*/
private
String
productName
;
/**
* 图片ID 关联smart_sys_file中id
*/
private
Long
icon
;
/**
* 产品类型ID 关联smart_product_type中id
*/
private
Long
typeId
;
/**
* 商城产品id
*/
private
String
shopProductId
;
/**
* 接入平台key 关联smart_sys_code中dict_key
*/
private
String
platformKey
;
/**
* 接入平台产品id
*/
private
String
platformProductId
;
/**
* 配网方式key 关联smart_sys_code中dict_key
*/
private
String
networkKey
;
}
src/main/java/com/glsx/api/remote/OrderValueFeignClient.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
remote
;
import
com.glsx.api.pojo.request.DeviceOrderValueReq
;
import
com.glsx.api.pojo.response.DeviceOrderValueResp
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
@FeignClient
(
name
=
"${feign.server.name}"
,
url
=
"${feign.server.url}"
)
public
interface
OrderValueFeignClient
{
@ResponseBody
@RequestMapping
(
value
=
"/orderValue/getList"
,
method
=
{
RequestMethod
.
POST
})
List
<
DeviceOrderValueResp
>
getList
(
@RequestBody
DeviceOrderValueReq
req
);
}
src/main/java/com/glsx/api/remote/ProductFeignClient.java
0 → 100644
View file @
46b706e
package
com
.
glsx
.
api
.
remote
;
import
com.glsx.api.pojo.request.ProductReq
;
import
com.glsx.api.pojo.response.ProductResp
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-16
*/
@FeignClient
(
name
=
"${feign.server.name}"
,
url
=
"${feign.server.url}"
)
public
interface
ProductFeignClient
{
@ResponseBody
@RequestMapping
(
value
=
"/product/getListByCondition"
,
method
=
{
RequestMethod
.
POST
})
List
<
ProductResp
>
getListByCondition
(
@RequestBody
ProductReq
req
);
}
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