Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-back
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josue
ejercicio2-framework-back
Commits
723df8b5
Commit
723df8b5
authored
Dec 17, 2021
by
Roberto Loayza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bcd Artefacts
parent
2ad3fa3d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
156 additions
and
4 deletions
+156
-4
BcdControlBean.java
src/main/java/com/bytesw/bytebot/bean/BcdControlBean.java
+14
-0
BcdControlController.java
...a/com/bytesw/bytebot/controller/BcdControlController.java
+19
-0
ActionRepository.java
...ain/java/com/bytesw/bytebot/etl/dao/ActionRepository.java
+2
-1
BcdControl.java
src/main/java/com/bytesw/bytebot/model/BcdControl.java
+28
-0
StatusBcdEnum.java
...in/java/com/bytesw/bytebot/model/enums/StatusBcdEnum.java
+34
-0
BcdControlRepository.java
...a/com/bytesw/bytebot/repository/BcdControlRepository.java
+8
-0
BcdControlService.java
...in/java/com/bytesw/bytebot/service/BcdControlService.java
+37
-0
FileManagementService.java
...ava/com/bytesw/bytebot/service/FileManagementService.java
+3
-3
OrquestadorService.java
...n/java/com/bytesw/bytebot/service/OrquestadorService.java
+11
-0
No files found.
src/main/java/com/bytesw/bytebot/bean/BcdControlBean.java
0 → 100644
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
bean
;
import
com.google.gson.annotations.Expose
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
@Getter
@Setter
public
class
BcdControlBean
implements
Serializable
{
@Expose
private
Long
id
;
@Expose
private
Long
agentId
;
@Expose
private
String
status
;
}
src/main/java/com/bytesw/bytebot/controller/BcdControlController.java
0 → 100644
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
controller
;
import
com.bytesw.bytebot.bean.BcdControlBean
;
import
com.bytesw.bytebot.service.BcdControlService
;
import
com.bytesw.xdf.annotation.ProgramSecurity
;
import
com.bytesw.xdf.controller.XDFController
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
()
@RequestMapping
(
"/service/settings/bcdControl"
)
@ProgramSecurity
(
"BCDCONTROL"
)
@Log4j2
public
class
BcdControlController
extends
XDFController
<
BcdControlBean
,
Long
>
{
public
BcdControlController
(
BcdControlService
service
)
{
super
(
service
);
}
}
src/main/java/com/bytesw/bytebot/etl/dao/ActionRepository.java
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
etl
.
dao
;
package
com
.
bytesw
.
bytebot
.
etl
.
dao
;
import
com.bytesw.bytebot.etl.model.Action
;
import
com.bytesw.bytebot.etl.model.Action
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.repository.CrudRepository
;
import
org.springframework.data.repository.CrudRepository
;
import
java.util.Optional
;
import
java.util.Optional
;
public
interface
ActionRepository
extends
CrudRepository
<
Action
,
Long
>
{
public
interface
ActionRepository
extends
CrudRepository
<
Action
,
Long
>
,
JpaSpecificationExecutor
<
Action
>
{
Optional
<
Action
>
findByIdentifier
(
String
identifier
);
Optional
<
Action
>
findByIdentifier
(
String
identifier
);
}
}
src/main/java/com/bytesw/bytebot/model/BcdControl.java
0 → 100644
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
model
;
import
lombok.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
@Entity
@Getter
@Setter
@ToString
@Table
(
name
=
"avb_bcd_control"
)
@NamedQuery
(
name
=
"BcdControl.findByPK"
,
query
=
"Select u from BcdControl u where u.id = ?1"
)
public
class
BcdControl
implements
Serializable
{
@Id
@Column
(
name
=
"bcd_id"
)
@SequenceGenerator
(
name
=
"AVB_BCD_CONTROL_GENERATOR"
,
sequenceName
=
"AVB_BCD_CONTROL_SEQ"
,
initialValue
=
1
,
allocationSize
=
1
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
,
generator
=
"AVB_BCD_CONTROL_GENERATOR"
)
private
Long
id
;
@Column
(
name
=
"agen_id"
)
private
Long
agentId
;
@Column
(
name
=
"bcd_status"
)
private
String
status
;
}
src/main/java/com/bytesw/bytebot/model/enums/StatusBcdEnum.java
0 → 100644
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
model
.
enums
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
public
enum
StatusBcdEnum
{
CARGANDO
(
"CG"
),
CARGADO
(
"CGD"
),
INDEXANDO
(
"IDX"
),
INDEXADO
(
"IDXD"
);
private
static
final
Map
<
String
,
StatusBcdEnum
>
map
=
new
HashMap
<>();
private
String
name
;
StatusBcdEnum
(
String
name
)
{
this
.
name
=
name
;
}
static
{
for
(
StatusBcdEnum
type
:
StatusBcdEnum
.
values
())
{
map
.
put
(
type
.
name
,
type
);
}
}
public
static
StatusBcdEnum
fromString
(
String
name
)
{
return
map
.
get
(
name
);
}
}
src/main/java/com/bytesw/bytebot/repository/BcdControlRepository.java
0 → 100644
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
repository
;
import
com.bytesw.bytebot.model.BcdControl
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.repository.CrudRepository
;
public
interface
BcdControlRepository
extends
CrudRepository
<
BcdControl
,
Long
>,
JpaSpecificationExecutor
<
BcdControl
>
{
}
src/main/java/com/bytesw/bytebot/service/BcdControlService.java
0 → 100644
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
service
;
import
com.bytesw.bytebot.bean.BcdControlBean
;
import
com.bytesw.bytebot.model.BcdControl
;
import
com.bytesw.bytebot.repository.BcdControlRepository
;
import
com.bytesw.xdf.service.XDFService
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.repository.CrudRepository
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Transactional
@Log4j2
public
class
BcdControlService
extends
XDFService
<
BcdControl
,
BcdControlBean
,
Long
>
{
protected
BcdControlService
(
BcdControlRepository
repository
)
{
super
(
repository
);
}
@Override
protected
BcdControl
toModel
(
BcdControl
model
,
BcdControlBean
bean
)
{
if
(
model
==
null
)
{
model
=
new
BcdControl
();
}
BeanUtils
.
copyProperties
(
bean
,
model
);
return
model
;
}
@Override
protected
BcdControlBean
toBean
(
BcdControl
model
)
{
BcdControlBean
bean
=
new
BcdControlBean
();
BeanUtils
.
copyProperties
(
model
,
bean
);
return
bean
;
}
}
src/main/java/com/bytesw/bytebot/service/FileManagementService.java
View file @
723df8b5
...
@@ -43,8 +43,8 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -43,8 +43,8 @@ import org.springframework.web.multipart.MultipartFile;
@Log4j2
@Log4j2
public
class
FileManagementService
{
public
class
FileManagementService
{
String
[]
validExtensions
=
new
String
[]{
"xls"
,
"xlsx"
};
String
[]
validExtensions
=
new
String
[]{
"xls"
,
"xlsx"
,
"csv"
};
String
[]
fileHeaders
=
new
String
[]{
"
TOPICO"
,
"SUBTOPICO"
,
"PREGUNTA"
,
"RESPUESTA
"
};
String
[]
fileHeaders
=
new
String
[]{
"
Class"
,
"Question"
,
"Answer
"
};
@Autowired
@Autowired
private
QuestionFileRepository
questionFileRepository
;
private
QuestionFileRepository
questionFileRepository
;
...
@@ -61,7 +61,7 @@ public class FileManagementService {
...
@@ -61,7 +61,7 @@ public class FileManagementService {
for
(
String
validExension
:
validExtensions
)
{
for
(
String
validExension
:
validExtensions
)
{
if
(
validExension
.
equalsIgnoreCase
(
fileExtension
.
trim
()))
{
if
(
validExension
.
equalsIgnoreCase
(
fileExtension
.
trim
()))
{
acceptedExtension
=
true
;
acceptedExtension
=
true
;
continue
;
continue
;
//Break?
}
}
}
}
...
...
src/main/java/com/bytesw/bytebot/service/OrquestadorService.java
0 → 100644
View file @
723df8b5
package
com
.
bytesw
.
bytebot
.
service
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Transactional
@Log4j2
public
class
OrquestadorService
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment