Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Moon-GD authored Feb 22, 2023
2 parents 30a1621 + 31f1a30 commit 77dd91c
Show file tree
Hide file tree
Showing 15 changed files with 387 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: softeerteam6/oilpocket-backend
tags: "latest"
tags: "main"

- name: Copy jar file to Docker context
run: cp ./backend/build/libs/backend-0.0.1-SNAPSHOT.war ./
run: cp ./backend/build/libs/backend-0.0.1-SNAPSHOT.jar ./

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
Expand All @@ -56,3 +56,4 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy frontend to EC2

on:
push:
branches: [dev, main]
branches: main



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
@Repository
public interface UserGasRecordDao extends CrudRepository<UserGasRecord, Long> {
@Query("select charge_date,gas_station_no, record_gas_type ,record_gas_amount ,refueling_price ,saving_price from user_gas_record ugr " +
"where user_no = :userNo;")
"where user_no = :userNo \n" +
"order by ugr.user_gas_record_no DESC")
List<UserGasRecord> findGasRecordListByUserId(@Param("userNo") Long userNo);
@Query("select * from user_gas_record where user_no = :userNo and month(charge_date) = month(:date) and year(charge_date) = year(:date)")
Optional<List<UserGasRecord>> findByMonthOfNow(@Param("user_no") Long userNo, @Param("date") LocalDate date);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Long calTodayUserGasAmount(UserGasRecordReqDto userGasRecordReqDto, GasSt
}

public Long calUserSavingAmount(Long userRefuelingPrice, Long userGasAmount, Long nationalAvgOilPrice) {
return userRefuelingPrice - nationalAvgOilPrice * userGasAmount;
return nationalAvgOilPrice * userGasAmount-userRefuelingPrice;
}


Expand All @@ -79,8 +79,6 @@ public List<UserGasRecordResDto> getUserRecords() {
User user = httpSessionService.getUserFromSession();
List<UserGasRecord> matchingUserGasRecords = userGasRecordDao.findGasRecordListByUserId(user.getUserNo());
List<UserGasRecordResDto> userGasRecordResDtos = toUserGasRecordResDtos(matchingUserGasRecords);
//날짜 최신순 정렬
Collections.sort(userGasRecordResDtos);
return userGasRecordResDtos;
}

Expand Down
15 changes: 15 additions & 0 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,19 @@ management:
exposure:
include: health, info, prometheus

logging:
level:
org:
springframework:
jdbc:
core:
JdbcTemplate: DEBUG
converter:
JdbcConverter: TRACE
repository:
support:
SimpleJdbcRepository: DEBUG




Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ void getUserRecords() {
assertEquals(2, result.size());
UserGasRecordResDto record1 = result.get(0);
UserGasRecordResDto record2 = result.get(1);
int compareDate = record1.getChargeDate().compareTo(record2.getChargeDate());
assertTrue(compareDate > 0); //날짜 정렬 확인
assertEquals(gasStation2.getName(), record1.getGasStationName());
assertEquals(gasStation1.getName(), record2.getGasStationName());
}
Expand Down
2 changes: 0 additions & 2 deletions frontEnd/public/js/login/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { routerCheckLogin } from "./fetch";
import { getLoginTemplate } from "./template";

const loginView = async () => {
await routerCheckLogin();

const $loginContainer = document.createElement("section");
$loginContainer.classList.add("loginArea");
$loginContainer.innerHTML = getLoginTemplate();
Expand Down
2 changes: 1 addition & 1 deletion frontEnd/public/js/main/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const getChatBotTemplate = () => `
<div class="chatBotArea__background">
<div class="chatBotArea__profile">
<img src="./img/main/chatBot/managerProfile.png" alt="profile">
<span>안녕하세요 주행자님. 어떤 것을 도와드릴까요?</span>
<span>어떤 것을 도와드릴까요?</span>
</div>
${chatTexts.map((chatText) => `
<div class="chatBotArea__chat">
Expand Down
5 changes: 4 additions & 1 deletion frontEnd/public/js/myPage/comparison/helperFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ const getImageName = (savePrice) => {
}
}

const setImageByName = ($image, imageName) => $image.setAttribute("src", imageLocationMapper[imageName]);
const setImageByName = ($image, imageName) => {
$image.setAttribute("src", imageLocationMapper[imageName]);
changeCSS($image, "opacity", 1);
};

const adjustChartsOnCard = (myPrice, commonPrice, $container) => {
const $myChart = myPrice > 0 ?
Expand Down
2 changes: 0 additions & 2 deletions frontEnd/public/js/register/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
import { getRegisterTemplate } from "./template.js";

const registerView = async () => {
await routerCheckLogin();

const $registerContainer = document.createElement("section");
$registerContainer.classList.add("main");
$registerContainer.innerHTML = getRegisterTemplate();
Expand Down
10 changes: 8 additions & 2 deletions frontEnd/public/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ import { inputOilInfoView } from "./myPage/inputOilInfo/view.js";
import { historyView } from "./myPage/history/view.js";
import { notFoundView } from "./notFound/view.js";
import { _$ } from "./common/utils.js";
import { fecthCheckLogin } from "./login/fetch.js";
import { fecthCheckLogin, routerCheckLogin } from "./login/fetch.js";
import { mapView } from "./mapView/view.js";
import { initTmap } from "./mapView/HelperFunction.js";

const $body = _$("body");

const router = async () => {
await fecthCheckLogin();
if(location.pathname === "/login" || location.pathname === "/register") {
await routerCheckLogin();
}
else {
await fecthCheckLogin();
}

const routes = [
{ path: "/", view: mainView },
Expand All @@ -36,6 +41,7 @@ const router = async () => {
isMatch: location.pathname === route.path
};
}).find((routeObj) => routeObj.isMatch)

if(!match) {
match = {
route: routes[routes.length - 1],
Expand Down
Loading

0 comments on commit 77dd91c

Please sign in to comment.