Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuyifan
2024-11-13 09:48:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0ee22213e4f9bff79091dc65c7429aced31306cf
0ee22213
1 parent
fa03d4a8
删除test
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
627 deletions
src/main/java/com/tianting/infoloop/mapper/TestExampleDbMapper.java
src/main/java/com/tianting/infoloop/model/db/TestExampleDb.java
src/main/java/com/tianting/infoloop/service/TestExampleDbService.java
src/main/java/com/tianting/infoloop/service/grpc/ExampleGrpcService.java
src/main/java/com/tianting/infoloop/service/impl/TestExampleDbServiceImpl.java
src/main/proto/ExampleService.proto
src/main/resources/mapper/TestExampleDbMapper.xml
src/main/java/com/tianting/infoloop/mapper/TestExampleDbMapper.java
deleted
100644 → 0
View file @
fa03d4a
package
com
.
tianting
.
infoloop
.
mapper
;
import
com.tianting.infoloop.inject.MyBaseMapper
;
import
com.tianting.infoloop.model.db.TestExampleDb
;
public
interface
TestExampleDbMapper
extends
MyBaseMapper
<
TestExampleDb
>
{
}
src/main/java/com/tianting/infoloop/model/db/TestExampleDb.java
deleted
100644 → 0
View file @
fa03d4a
package
com
.
tianting
.
infoloop
.
model
.
db
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* 例子DB
* @TableName test_example_db
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
value
=
"test_example_db"
)
public
class
TestExampleDb
extends
Model
<
TestExampleDb
>
implements
Serializable
{
/**
*
*/
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 企业 ID
*/
private
Integer
enterpriseId
;
/**
* 用户昵称
*/
private
String
name
;
/**
* 用户状态;启用:1;停用:2
*/
private
Integer
status
;
/**
* 创建人 ID
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Integer
createdBy
;
/**
* 创建时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createdAt
;
/**
* 创建来源
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Integer
creationSource
;
/**
* 修改人 ID
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Integer
updatedBy
;
/**
* 修改时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updatedAt
;
/**
* 修改来源
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Integer
updateSource
;
/**
* 是否删除;0:未删除,1:已删除
*/
@TableLogic
private
Boolean
isDeleted
;
}
\ No newline at end of file
src/main/java/com/tianting/infoloop/service/TestExampleDbService.java
deleted
100644 → 0
View file @
fa03d4a
package
com
.
tianting
.
infoloop
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.tianting.infoloop.grpc.exampleservice.TestExampleDbCreation
;
import
com.tianting.infoloop.grpc.exampleservice.TestExampleDbModification
;
import
com.tianting.infoloop.model.db.TestExampleDb
;
import
java.util.List
;
/**
* @author zhuyf
* @description 针对表【 test_example_db(例子DB)】的数据库操作Service
* @createDate 2024-10-12 13:53:16
*/
public
interface
TestExampleDbService
extends
IService
<
TestExampleDb
>
{
TestExampleDb
createTestExampleDb
(
TestExampleDbCreation
creation
);
List
<
TestExampleDb
>
batchCreateTestExampleDb
(
List
<
TestExampleDbCreation
>
creationsList
);
boolean
updateTestExampleDb
(
TestExampleDbModification
modification
);
boolean
batchUpdateTestExampleDb
(
List
<
TestExampleDbModification
>
modificationsList
);
}
src/main/java/com/tianting/infoloop/service/grpc/ExampleGrpcService.java
deleted
100644 → 0
View file @
fa03d4a
package
com
.
tianting
.
infoloop
.
service
.
grpc
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.tianting.infoloop.grpc.exampleservice.BatchCreateTestExampleDbRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.BatchCreateTestExampleDbRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.BatchUpdateTestExampleDbRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.BatchUpdateTestExampleDbRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.CreateTestExampleDbRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.CreateTestExampleDbRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.DeleteTestExampleDbByIdsRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.DeleteTestExampleDbRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.ExampleServiceRpcGrpc
;
import
com.tianting.infoloop.grpc.exampleservice.GetAllTestExampleDbRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.GetAllTestExampleDbRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.GetTestExampleDbByIdRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.GetTestExampleDbByIdRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.GetTestExampleDbByIdsRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.GetTestExampleDbByIdsRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.QueryTestExampleDbByConditionRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.QueryTestExampleDbByConditionRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.QueryTestExampleDbByPaginationRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.QueryTestExampleDbByPaginationRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.SingleTestExampleDbRpcResponse
;
import
com.tianting.infoloop.grpc.exampleservice.UpdateTestExampleDbRpcRequest
;
import
com.tianting.infoloop.grpc.exampleservice.UpdateTestExampleDbRpcResponse
;
import
com.tianting.infoloop.model.db.TestExampleDb
;
import
com.tianting.infoloop.service.TestExampleDbService
;
import
com.tianting.infoloop.utils.ProtoBeanUtil
;
import
io.grpc.Status
;
import
io.grpc.stub.StreamObserver
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.stream.Collectors
;
import
static
com
.
tianting
.
infoloop
.
constants
.
ConfigConstants
.
DATA_SOURCE_MASTER
;
import
static
com
.
tianting
.
infoloop
.
constants
.
ConfigConstants
.
DATA_SOURCE_SLAVE
;
@Slf4j
@Service
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
ExampleGrpcService
extends
ExampleServiceRpcGrpc
.
ExampleServiceRpcImplBase
{
private
final
TestExampleDbService
testExampleDbService
;
@Override
@DS
(
DATA_SOURCE_SLAVE
)
public
void
getTestExampleDbById
(
final
GetTestExampleDbByIdRpcRequest
request
,
final
StreamObserver
<
GetTestExampleDbByIdRpcResponse
>
responseObserver
)
{
final
var
builder
=
GetTestExampleDbByIdRpcResponse
.
newBuilder
();
try
{
final
var
data
=
testExampleDbService
.
getById
(
request
.
getId
());
if
(
data
!=
null
)
{
builder
.
setResponse
(
ProtoBeanUtil
.
beanToProto
(
data
,
SingleTestExampleDbRpcResponse
.
class
));
}
}
catch
(
final
Exception
e
)
{
log
.
error
(
"getTestExampleDbById error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_SLAVE
)
public
void
getTestExampleDbByIds
(
final
GetTestExampleDbByIdsRpcRequest
request
,
final
StreamObserver
<
GetTestExampleDbByIdsRpcResponse
>
responseObserver
)
{
final
var
builder
=
GetTestExampleDbByIdsRpcResponse
.
newBuilder
();
try
{
if
(
request
.
getIdsList
().
isEmpty
())
{
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
return
;
}
final
var
list
=
testExampleDbService
.
listByIds
(
request
.
getIdsList
());
if
(!
list
.
isEmpty
())
{
builder
.
addAllResponses
(
ProtoBeanUtil
.
beanListToProtoList
(
list
,
SingleTestExampleDbRpcResponse
.
class
));
}
}
catch
(
final
Exception
e
)
{
log
.
error
(
"getTestExampleDbByIds error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_SLAVE
)
public
void
getAllTestExampleDb
(
final
GetAllTestExampleDbRpcRequest
request
,
final
StreamObserver
<
GetAllTestExampleDbRpcResponse
>
responseObserver
)
{
final
var
builder
=
GetAllTestExampleDbRpcResponse
.
newBuilder
();
try
{
final
var
list
=
testExampleDbService
.
list
();
if
(!
list
.
isEmpty
())
{
builder
.
addAllResponses
(
ProtoBeanUtil
.
beanListToProtoList
(
list
,
SingleTestExampleDbRpcResponse
.
class
));
}
}
catch
(
final
Exception
e
)
{
log
.
error
(
"getAllTestExampleDb error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_SLAVE
)
public
void
queryTestExampleDbByCondition
(
final
QueryTestExampleDbByConditionRpcRequest
request
,
final
StreamObserver
<
QueryTestExampleDbByConditionRpcResponse
>
responseObserver
)
{
final
var
builder
=
QueryTestExampleDbByConditionRpcResponse
.
newBuilder
();
try
{
LambdaQueryWrapper
<
TestExampleDb
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
if
(
request
.
hasName
())
{
queryWrapper
.
like
(
TestExampleDb:
:
getName
,
request
.
getName
());
}
if
(
request
.
hasStatus
())
{
queryWrapper
.
eq
(
TestExampleDb:
:
getStatus
,
request
.
getStatusValue
());
}
final
var
list
=
testExampleDbService
.
list
(
queryWrapper
);
if
(!
list
.
isEmpty
())
{
builder
.
addAllResponses
(
ProtoBeanUtil
.
beanListToProtoList
(
list
,
SingleTestExampleDbRpcResponse
.
class
));
}
}
catch
(
final
Exception
e
)
{
log
.
error
(
"queryTestExampleDbByCondition error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_SLAVE
)
public
void
queryTestExampleDbByPagination
(
final
QueryTestExampleDbByPaginationRpcRequest
request
,
final
StreamObserver
<
QueryTestExampleDbByPaginationRpcResponse
>
responseObserver
)
{
final
var
builder
=
QueryTestExampleDbByPaginationRpcResponse
.
newBuilder
();
try
{
IPage
<
TestExampleDb
>
page
=
new
Page
<>(
request
.
getPageNo
(),
request
.
getPageSize
());
LambdaQueryWrapper
<
TestExampleDb
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
if
(
request
.
hasName
())
{
queryWrapper
.
like
(
TestExampleDb:
:
getName
,
request
.
getName
());
}
if
(
request
.
hasStatus
())
{
queryWrapper
.
eq
(
TestExampleDb:
:
getStatus
,
request
.
getStatusValue
());
}
final
var
result
=
testExampleDbService
.
page
(
page
,
queryWrapper
);
builder
.
setTotal
(
result
.
getTotal
());
builder
.
setPages
(
result
.
getPages
());
if
(!
result
.
getRecords
().
isEmpty
())
{
builder
.
addAllResponses
(
ProtoBeanUtil
.
beanListToProtoList
(
result
.
getRecords
(),
SingleTestExampleDbRpcResponse
.
class
));
}
}
catch
(
final
Exception
e
)
{
log
.
error
(
"queryTestExampleDbByCondition error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_MASTER
)
public
void
createTestExampleDb
(
final
CreateTestExampleDbRpcRequest
request
,
final
StreamObserver
<
CreateTestExampleDbRpcResponse
>
responseObserver
)
{
final
var
builder
=
CreateTestExampleDbRpcResponse
.
newBuilder
();
builder
.
setIsCreated
(
false
);
try
{
final
var
data
=
testExampleDbService
.
createTestExampleDb
(
request
.
getCreation
());
builder
.
setIsCreated
(
data
!=
null
).
setId
(
data
==
null
?
0
:
data
.
getId
());
}
catch
(
final
Exception
e
)
{
log
.
error
(
"createTestExampleDb error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_MASTER
)
public
void
batchCreateTestExampleDb
(
final
BatchCreateTestExampleDbRpcRequest
request
,
final
StreamObserver
<
BatchCreateTestExampleDbRpcResponse
>
responseObserver
)
{
final
var
builder
=
BatchCreateTestExampleDbRpcResponse
.
newBuilder
();
builder
.
setIsCreated
(
false
);
try
{
final
var
list
=
testExampleDbService
.
batchCreateTestExampleDb
(
request
.
getCreationsList
());
builder
.
setIsCreated
(
list
.
size
()
==
request
.
getCreationsCount
()).
addAllIds
(
list
.
stream
().
map
(
TestExampleDb:
:
getId
).
collect
(
Collectors
.
toList
()));
}
catch
(
final
Exception
e
)
{
log
.
error
(
"batchCreateTestExampleDb error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_MASTER
)
public
void
updateTestExampleDb
(
final
UpdateTestExampleDbRpcRequest
request
,
final
StreamObserver
<
UpdateTestExampleDbRpcResponse
>
responseObserver
)
{
final
var
builder
=
UpdateTestExampleDbRpcResponse
.
newBuilder
();
builder
.
setIsUpdated
(
false
);
try
{
builder
.
setIsUpdated
(
testExampleDbService
.
updateTestExampleDb
(
request
.
getModification
()));
}
catch
(
final
Exception
e
)
{
log
.
error
(
"updateTestExampleDb error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_MASTER
)
public
void
batchUpdateTestExampleDb
(
final
BatchUpdateTestExampleDbRpcRequest
request
,
final
StreamObserver
<
BatchUpdateTestExampleDbRpcResponse
>
responseObserver
)
{
final
var
builder
=
BatchUpdateTestExampleDbRpcResponse
.
newBuilder
();
builder
.
setIsUpdated
(
false
);
try
{
builder
.
setIsUpdated
(
testExampleDbService
.
batchUpdateTestExampleDb
(
request
.
getModificationsList
()));
}
catch
(
final
Exception
e
)
{
log
.
error
(
"batchUpdateTestExampleDb error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_MASTER
)
public
void
deleteTestExampleDbByIds
(
final
DeleteTestExampleDbByIdsRpcRequest
request
,
final
StreamObserver
<
DeleteTestExampleDbRpcResponse
>
responseObserver
)
{
final
var
builder
=
DeleteTestExampleDbRpcResponse
.
newBuilder
();
builder
.
setIsDeleted
(
false
);
try
{
if
(
request
.
getIdsList
().
isEmpty
())
{
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
return
;
}
builder
.
setIsDeleted
(
testExampleDbService
.
removeBatchByIds
(
request
.
getIdsList
()));
}
catch
(
final
Exception
e
)
{
log
.
error
(
"deleteTestExampleDbByIds error;"
,
e
);
responseObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
}
}
src/main/java/com/tianting/infoloop/service/impl/TestExampleDbServiceImpl.java
deleted
100644 → 0
View file @
fa03d4a
package
com
.
tianting
.
infoloop
.
service
.
impl
;
import
cn.hutool.extra.spring.SpringUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.tianting.infoloop.grpc.exampleservice.TestExampleDbCreation
;
import
com.tianting.infoloop.grpc.exampleservice.TestExampleDbModification
;
import
com.tianting.infoloop.mapper.TestExampleDbMapper
;
import
com.tianting.infoloop.model.db.TestExampleDb
;
import
com.tianting.infoloop.service.TestExampleDbService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.lang.Nullable
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author zhuyf
* @description 针对表【 test_example_db(例子DB)】的数据库操作Service实现
* @createDate 2024-10-12 13:53:16
*/
@Slf4j
@Service
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
TestExampleDbServiceImpl
extends
ServiceImpl
<
TestExampleDbMapper
,
TestExampleDb
>
implements
TestExampleDbService
{
private
final
TestExampleDbMapper
testExampleDbMapper
;
@Override
@Nullable
public
TestExampleDb
createTestExampleDb
(
TestExampleDbCreation
creation
)
{
TestExampleDb
testExampleDb
=
new
TestExampleDb
();
testExampleDb
.
setName
(
creation
.
getName
());
testExampleDb
.
setStatus
(
creation
.
getStatusValue
());
final
var
insert
=
testExampleDbMapper
.
insert
(
testExampleDb
);
return
insert
>
0
?
testExampleDb
:
null
;
}
@Override
public
List
<
TestExampleDb
>
batchCreateTestExampleDb
(
List
<
TestExampleDbCreation
>
creationsList
)
{
var
list
=
creationsList
.
stream
().
map
(
creation
->
new
TestExampleDb
()
.
setName
(
creation
.
getName
())
.
setStatus
(
creation
.
getStatusValue
())).
collect
(
Collectors
.
toList
());
return
SpringUtil
.
getBean
(
TestExampleDbServiceImpl
.
class
).
saveBatch
(
list
)
?
list
:
Collections
.
emptyList
();
}
@Override
public
boolean
updateTestExampleDb
(
TestExampleDbModification
modification
)
{
var
testExampleDb
=
new
TestExampleDb
();
testExampleDb
.
setId
(
modification
.
getId
());
if
(
modification
.
hasName
())
{
testExampleDb
.
setName
(
modification
.
getName
());
}
if
(
modification
.
hasStatus
())
{
testExampleDb
.
setStatus
(
modification
.
getStatusValue
());
}
return
testExampleDbMapper
.
updateById
(
testExampleDb
)
>
0
;
}
@Override
public
boolean
batchUpdateTestExampleDb
(
List
<
TestExampleDbModification
>
modificationsList
)
{
final
var
list
=
modificationsList
.
stream
().
map
(
modification
->
{
var
testExampleDb
=
new
TestExampleDb
();
testExampleDb
.
setId
(
modification
.
getId
());
if
(
modification
.
hasName
())
{
testExampleDb
.
setName
(
modification
.
getName
());
}
if
(
modification
.
hasStatus
())
{
testExampleDb
.
setStatus
(
modification
.
getStatusValue
());
}
return
testExampleDb
;
}).
collect
(
Collectors
.
toList
());
return
SpringUtil
.
getBean
(
TestExampleDbServiceImpl
.
class
).
updateBatchById
(
list
);
}
}
src/main/proto/ExampleService.proto
deleted
100644 → 0
View file @
fa03d4a
syntax
=
"proto3"
;
option
java_multiple_files
=
true
;
option
java_package
=
"com.tianting.infoloop.grpc.exampleservice"
;
option
java_outer_classname
=
"ExampleServiceProto"
;
option
objc_class_prefix
=
"OP"
;
package
com
.
tianting.infoloop.grpc.exampleservice
;
service
ExampleServiceRpc
{
rpc
GetTestExampleDbById
(
GetTestExampleDbByIdRpcRequest
)
returns
(
GetTestExampleDbByIdRpcResponse
)
{}
rpc
GetTestExampleDbByIds
(
GetTestExampleDbByIdsRpcRequest
)
returns
(
GetTestExampleDbByIdsRpcResponse
)
{}
rpc
GetAllTestExampleDb
(
GetAllTestExampleDbRpcRequest
)
returns
(
GetAllTestExampleDbRpcResponse
)
{}
rpc
QueryTestExampleDbByCondition
(
QueryTestExampleDbByConditionRpcRequest
)
returns
(
QueryTestExampleDbByConditionRpcResponse
)
{}
rpc
QueryTestExampleDbByPagination
(
QueryTestExampleDbByPaginationRpcRequest
)
returns
(
QueryTestExampleDbByPaginationRpcResponse
)
{}
rpc
CreateTestExampleDb
(
CreateTestExampleDbRpcRequest
)
returns
(
CreateTestExampleDbRpcResponse
)
{}
rpc
BatchCreateTestExampleDb
(
BatchCreateTestExampleDbRpcRequest
)
returns
(
BatchCreateTestExampleDbRpcResponse
)
{}
rpc
UpdateTestExampleDb
(
UpdateTestExampleDbRpcRequest
)
returns
(
UpdateTestExampleDbRpcResponse
)
{}
rpc
BatchUpdateTestExampleDb
(
BatchUpdateTestExampleDbRpcRequest
)
returns
(
BatchUpdateTestExampleDbRpcResponse
)
{}
rpc
DeleteTestExampleDbByIds
(
DeleteTestExampleDbByIdsRpcRequest
)
returns
(
DeleteTestExampleDbRpcResponse
)
{}
}
enum
TestExampleDbStatusEnum
{
STATUS_UNKNOWN
=
0
;
STATUS_ENABLED
=
1
;
STATUS_DISABLED
=
2
;
}
message
SingleTestExampleDbRpcResponse
{
int32
id
=
1
;
int32
enterpriseId
=
2
;
string
name
=
3
;
TestExampleDbStatusEnum
status
=
4
;
int32
createdBy
=
5
;
int64
createdAt
=
6
;
int32
creationSource
=
7
;
int32
updatedBy
=
8
;
int64
updatedAt
=
9
;
int32
updateSource
=
10
;
bool
isDeleted
=
11
;
}
message
GetTestExampleDbByIdRpcRequest
{
int32
id
=
1
;
}
message
GetTestExampleDbByIdRpcResponse
{
SingleTestExampleDbRpcResponse
response
=
1
;
}
message
GetTestExampleDbByIdsRpcRequest
{
repeated
int32
ids
=
1
;
}
message
GetTestExampleDbByIdsRpcResponse
{
repeated
SingleTestExampleDbRpcResponse
responses
=
1
;
}
message
GetAllTestExampleDbRpcRequest
{
}
message
GetAllTestExampleDbRpcResponse
{
repeated
SingleTestExampleDbRpcResponse
responses
=
1
;
}
message
QueryTestExampleDbByConditionRpcRequest
{
optional
string
name
=
1
;
optional
TestExampleDbStatusEnum
status
=
2
;
}
message
QueryTestExampleDbByConditionRpcResponse
{
repeated
SingleTestExampleDbRpcResponse
responses
=
1
;
}
message
QueryTestExampleDbByPaginationRpcRequest
{
optional
string
name
=
1
;
optional
TestExampleDbStatusEnum
status
=
2
;
int32
pageNo
=
3
;
int32
pageSize
=
4
;
}
message
QueryTestExampleDbByPaginationRpcResponse
{
int64
total
=
1
;
int64
pages
=
2
;
repeated
SingleTestExampleDbRpcResponse
responses
=
3
;
}
message
TestExampleDbCreation
{
string
name
=
1
;
TestExampleDbStatusEnum
status
=
2
;
}
message
CreateTestExampleDbRpcRequest
{
TestExampleDbCreation
creation
=
1
;
}
message
CreateTestExampleDbRpcResponse
{
int32
id
=
1
;
bool
isCreated
=
2
;
}
message
BatchCreateTestExampleDbRpcRequest
{
repeated
TestExampleDbCreation
creations
=
1
;
}
message
BatchCreateTestExampleDbRpcResponse
{
repeated
int32
ids
=
1
;
bool
isCreated
=
2
;
}
message
TestExampleDbModification
{
int32
id
=
1
;
optional
string
name
=
2
;
optional
TestExampleDbStatusEnum
status
=
3
;
}
message
UpdateTestExampleDbRpcRequest
{
TestExampleDbModification
modification
=
1
;
}
message
UpdateTestExampleDbRpcResponse
{
bool
isUpdated
=
1
;
}
message
BatchUpdateTestExampleDbRpcRequest
{
repeated
TestExampleDbModification
modifications
=
1
;
}
message
BatchUpdateTestExampleDbRpcResponse
{
bool
isUpdated
=
1
;
}
message
DeleteTestExampleDbByIdsRpcRequest
{
repeated
int32
ids
=
1
;
}
message
DeleteTestExampleDbRpcResponse
{
bool
isDeleted
=
1
;
}
src/main/resources/mapper/TestExampleDbMapper.xml
deleted
100644 → 0
View file @
fa03d4a
<?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.tianting.infoloop.mapper.TestExampleDbMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.tianting.infoloop.model.db.TestExampleDb"
>
<id
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<id
property=
"enterpriseId"
column=
"enterpriseId"
jdbcType=
"INTEGER"
/>
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
<result
property=
"status"
column=
"status"
jdbcType=
"TINYINT"
/>
<result
property=
"createdBy"
column=
"createdBy"
jdbcType=
"INTEGER"
/>
<result
property=
"createdAt"
column=
"createdAt"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"creationSource"
column=
"creationSource"
jdbcType=
"INTEGER"
/>
<result
property=
"updatedBy"
column=
"updatedBy"
jdbcType=
"INTEGER"
/>
<result
property=
"updatedAt"
column=
"updatedAt"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateSource"
column=
"updateSource"
jdbcType=
"INTEGER"
/>
<result
property=
"isDeleted"
column=
"isDeleted"
jdbcType=
"TINYINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,enterpriseId,name,status,
createdBy,createdAt,creationSource,
updatedBy,updatedAt,updateSource,
isDeleted
</sql>
</mapper>
Please
register
or
login
to post a comment