Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
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
Narendar Vakiti
mytime
Commits
3a7ad803
Commit
3a7ad803
authored
May 14, 2019
by
Vijay Akula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the issues related to team details
parent
b9280f6e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
24 deletions
+74
-24
EmailController.java
...ain/java/com/nisum/myteam/controller/EmailController.java
+1
-5
LoginReportsController.java
...a/com/nisum/myteam/controller/LoginReportsController.java
+29
-0
ILoginReportsService.java
...n/java/com/nisum/myteam/service/ILoginReportsService.java
+6
-0
IMailService.java
src/main/java/com/nisum/myteam/service/IMailService.java
+0
-2
LoginReportService.java
...ava/com/nisum/myteam/service/impl/LoginReportService.java
+37
-0
MailService.java
src/main/java/com/nisum/myteam/service/impl/MailService.java
+1
-17
0_2019-05-14_2019-05-14.pdf
src/main/webapp/WEB-INF/reports/0_2019-05-14_2019-05-14.pdf
+0
-0
No files found.
src/main/java/com/nisum/myteam/controller/EmailController.java
View file @
3a7ad803
...
...
@@ -28,9 +28,5 @@ public class EmailController {
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
@RequestMapping
(
value
=
"/deleteReport/{fileName}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
TEXT_PLAIN_VALUE
)
public
ResponseEntity
<
String
>
deletePdfReport
(
@PathVariable
(
"fileName"
)
String
fileName
)
{
String
response
=
mailService
.
deletePdfReport
(
fileName
);
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
OK
);
}
}
src/main/java/com/nisum/myteam/controller/LoginReportsController.java
0 → 100644
View file @
3a7ad803
package
com
.
nisum
.
myteam
.
controller
;
import
com.nisum.myteam.service.ILoginReportsService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
public
class
LoginReportsController
{
@Autowired
private
ILoginReportsService
reportsService
;
@RequestMapping
(
value
=
"/deleteReport/{fileName}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
TEXT_PLAIN_VALUE
)
public
ResponseEntity
<
String
>
deletePdfReport
(
@PathVariable
(
"fileName"
)
String
fileName
)
{
String
response
=
reportsService
.
deletePdfReport
(
fileName
);
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
OK
);
}
}
src/main/java/com/nisum/myteam/service/ILoginReportsService.java
0 → 100644
View file @
3a7ad803
package
com
.
nisum
.
myteam
.
service
;
public
interface
ILoginReportsService
{
public
String
deletePdfReport
(
String
fileName
);
}
src/main/java/com/nisum/myteam/service/IMailService.java
View file @
3a7ad803
...
...
@@ -17,8 +17,6 @@ public interface IMailService {
public
String
sendEmailWithAttachment
(
EmailDomain
emailObj
);
public
String
deletePdfReport
(
String
fileName
);
public
void
sendLeaveNotification
(
Mail
mail
)
throws
MessagingException
,
IOException
;
public
void
sendProjectNotification
(
Mail
mail
)
throws
MessagingException
,
IOException
;
...
...
src/main/java/com/nisum/myteam/service/impl/LoginReportService.java
0 → 100644
View file @
3a7ad803
package
com
.
nisum
.
myteam
.
service
.
impl
;
import
com.nisum.myteam.service.ILoginReportsService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.stereotype.Service
;
import
java.io.File
;
import
java.io.IOException
;
@Service
@Slf4j
public
class
LoginReportService
implements
ILoginReportsService
{
@Autowired
ResourceLoader
resourceLoader
;
@Override
public
String
deletePdfReport
(
String
fileName
)
{
String
response
=
""
;
try
{
File
file
=
resourceLoader
.
getResource
(
"/WEB-INF/reports/"
+
fileName
+
".pdf"
).
getFile
();
if
(
null
!=
file
&&
file
.
exists
())
{
boolean
status
=
file
.
delete
();
if
(
status
)
{
response
=
"Success"
;
}
}
}
catch
(
IOException
e
)
{
response
=
"Report deletion failed due to: "
+
e
.
getMessage
();
log
.
error
(
"Report deletion failed due to: "
,
e
);
}
return
response
;
}
}
src/main/java/com/nisum/myteam/service/impl/MailService.java
View file @
3a7ad803
...
...
@@ -91,23 +91,7 @@ public class MailService implements IMailService {
return
response
;
}
@Override
public
String
deletePdfReport
(
String
fileName
)
{
String
response
=
""
;
try
{
File
file
=
resourceLoader
.
getResource
(
"/WEB-INF/reports/"
+
fileName
+
".pdf"
).
getFile
();
if
(
null
!=
file
&&
file
.
exists
()){
boolean
status
=
file
.
delete
();
if
(
status
){
response
=
"Success"
;
}
}
}
catch
(
IOException
e
)
{
response
=
"Report deletion failed due to: "
+
e
.
getMessage
();
logger
.
error
(
"Report deletion failed due to: "
,
e
);
}
return
response
;
}
public
void
sendLeaveNotification
(
Mail
mail
)
throws
MessagingException
,
IOException
{
...
...
src/main/webapp/WEB-INF/reports/0_2019-05-14_2019-05-14.pdf
View file @
3a7ad803
No preview for this file type
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