Skip to content

Commit

Permalink
Merge branch 'dev' into feat/#19
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehongg committed Jan 27, 2023
2 parents e3740ca + 7119b26 commit bebbfb4
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public ResponseEntity<LoginResponse> getLogin(@RequestParam("code") String code)
return ResponseEntity.ok(loginResponse);
}


@PostMapping("/makeAccount")
public ResponseEntity<AccountResponse> makeAccount(@RequestBody HashMap<String, String> param) {
Boolean result;
Expand All @@ -75,4 +74,6 @@ public String deleteAccount(HttpSession session, @RequestParam("token") String t
}
return resultCode;
}
}

}

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

package com.greenpoint.server.auth.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.greenpoint.server.auth.model.KakaoProfile;
import com.greenpoint.server.auth.model.KakaoProfile;
import com.greenpoint.server.customer.model.Customer;
import com.greenpoint.server.customer.repository.CustomerRepository;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -13,7 +14,6 @@
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;


import java.sql.SQLOutput;

import javax.servlet.http.HttpSession;
Expand All @@ -23,8 +23,7 @@
@Service
public class UserService {
@Autowired
private CustomerRepository customerRepository;

CustomerRepository customerRepository;

public Object[] saveUser(String token) {

Expand Down Expand Up @@ -76,14 +75,15 @@ public String getUserInfoByAccessToken(String accessToken) {
return restTemplate.postForObject(url, request, String.class);
}
public Boolean getUserInfoByForm(HashMap<String, String> param) {
// 닉네임 , 전화번호
Customer user;
String token = param.get("token");
System.out.println("token = " + token);
try{
user = customerRepository.findByKakaoToken(token);
user.setContact(param.get("contact"));
user.setNickname(param.get("nickname"));
user.setLatitude(Double.valueOf(param.get("latitude")));
user.setLongitude(Double.valueOf(param.get("longitude")));
// user = Customer.from(param.get("nickname"), param.get("contact"));
user = customerRepository.save(user);
if(user == null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.xml.ws.Response;
//import javax.xml.ws.Response;
import java.util.List;

@RestController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.xml.ws.Response;
//import javax.xml.ws.Response;
import java.util.List;

@RestController
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/greenpoint/server/store/model/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.greenpoint.server.history.model.History;
import com.greenpoint.server.menu.model.Menu;
import com.greenpoint.server.point.model.Point;
import com.greenpoint.server.storeLevel.model.StoreLevel;
import lombok.*;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
Expand Down Expand Up @@ -34,6 +35,8 @@ public class Store extends BaseEntity {
private double latitude;
private double longitude;

@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
private StoreLevel storeLevel;
public static Store from(StoreRequest request){
return Store.builder()
.loginID(request.getLoginID())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.greenpoint.server.storeLevel.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("/api")
public class StoreLevelController {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.greenpoint.server.storeLevel.model;

import com.greenpoint.server.common.BaseEntity;
import lombok.*;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Where(clause = "deleted = false")
@SQLDelete(sql = "UPDATE storelevel SET deleted = true Where id = ?")
public class StoreLevel extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String image;
private int grade;
private int lpoint;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.greenpoint.server.storeLevel.repository;

import com.greenpoint.server.storeLevel.model.StoreLevel;
import org.springframework.data.jpa.repository.JpaRepository;

public interface StoreLevelRepository extends JpaRepository<StoreLevel, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.greenpoint.server.storeLevel.service;

import com.greenpoint.server.storeLevel.repository.StoreLevelRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StoreLevelService {

@Autowired
private StoreLevelRepository storeLevelRepository;




}

0 comments on commit bebbfb4

Please sign in to comment.