started on gmail controller

This commit is contained in:
heyethereum
2024-07-25 08:20:17 +08:00
parent d29dddd133
commit da12ec70c6
4 changed files with 57 additions and 0 deletions

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@ target/
.DS_Store
*/.DS_Store
**/.DS_Store
credentials.json
### STS ###
.apt_generated

12
pom.xml
View File

@@ -68,6 +68,18 @@
<artifactId>hypersistence-utils-hibernate-63</artifactId>
<version>3.8.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>2.6.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty -->
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.36.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-gmail</artifactId>

View File

@@ -0,0 +1,33 @@
package com.safeqr.app.gmail.controller;
import com.safeqr.app.gmail.service.GmailService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
import static com.safeqr.app.constants.APIConstants.API_VERSION;
@RestController
@RequestMapping(API_VERSION)
public class GmailController {
private static final Logger logger = LoggerFactory.getLogger(GmailController.class);
GmailService gmailService;
@Autowired
public GmailController(GmailService gmailService) {
this.gmailService = gmailService;
}
@GetMapping(value = "/gmail/authenticate", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> authenticate() {
logger.info("Health Check");
return ResponseEntity.ok(Map.of("version", "SafeQR v1.0.2"));
}
}

View File

@@ -0,0 +1,11 @@
package com.safeqr.app.gmail.service;
import com.safeqr.app.qrcode.service.EmailVerificationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@Service
public class GmailService {
private static final Logger logger = LoggerFactory.getLogger(GmailService.class);
}